From 1627e0f36b0891815d53b4f27e3289ec0065d8df Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 13 Nov 2018 17:38:00 +0100 Subject: Bug 692592: Handle relative file links. The core library doesn't know where a document comes from, since we can open it as a stream, etc. Let the viewer handle relative file URLs. --- source/pdf/pdf-link.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'source') diff --git a/source/pdf/pdf-link.c b/source/pdf/pdf-link.c index ae5beaa3..6d34cc6a 100644 --- a/source/pdf/pdf-link.c +++ b/source/pdf/pdf-link.c @@ -138,18 +138,12 @@ pdf_parse_file_spec(fz_context *ctx, pdf_document *doc, pdf_obj *file_spec, pdf_ #ifdef _WIN32 if (!pdf_name_eq(ctx, pdf_dict_get(ctx, file_spec, PDF_NAME(FS)), PDF_NAME(URL))) { - /* move the file name into the expected place and use the expected path separator */ - char *c; + /* Fix up the drive letter (change "/C/Documents/Foo" to "C:/Documents/Foo") */ if (path[0] == '/' && (('A' <= path[1] && path[1] <= 'Z') || ('a' <= path[1] && path[1] <= 'z')) && path[2] == '/') { path[0] = path[1]; path[1] = ':'; } - for (c = path; *c; c++) - { - if (*c == '/') - *c = '\\'; - } } #endif -- cgit v1.2.3