diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2020-04-20 11:00:35 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2020-04-20 11:25:29 +0200 |
commit | 4ffcdc2e7ae94fe263855797e235f4ab4246c221 (patch) | |
tree | 17c17abbbad1c2df56e166fcde1077e6149067ca /platform/x11 | |
parent | 7b6820fcd88cf1737b36bc0302a8ea90ea20f2dc (diff) |
Add and use fz_realpath function with POSIX and Windows implementations.
Diffstat (limited to 'platform/x11')
-rw-r--r-- | platform/x11/pdfapp.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c index 1145431ac..aa53e6564 100644 --- a/platform/x11/pdfapp.c +++ b/platform/x11/pdfapp.c @@ -40,24 +40,6 @@ stat_mtime(const char *path) return info.st_mtime; } -#ifdef _WIN32 -static const char * -realpath(const char *path, char buf[PATH_MAX]) -{ - wchar_t wpath[PATH_MAX]; - wchar_t wbuf[PATH_MAX]; - int i; - MultiByteToWideChar(CP_UTF8, 0, path, -1, wpath, PATH_MAX); - GetFullPathNameW(wpath, PATH_MAX, wbuf, NULL); - WideCharToMultiByte(CP_UTF8, 0, wbuf, -1, buf, PATH_MAX, NULL, NULL); - for (i=0; buf[i]; ++i) - if (buf[i] == '\\') - buf[i] = '/'; - return buf; -} - -#endif - static int convert_to_accel_path(fz_context *ctx, char outname[], char *absname, size_t len) { char *tmpdir; @@ -89,7 +71,7 @@ static int convert_to_accel_path(fz_context *ctx, char outname[], char *absname, static int get_accelerator_filename(fz_context *ctx, char outname[], size_t len, const char *filename) { char absname[PATH_MAX]; - if (!realpath(filename, absname)) + if (!fz_realpath(filename, absname)) return 0; if (!convert_to_accel_path(ctx, outname, absname, len)) return 0; |