From 8e2c85fe81020b3703e37a127ccc85625350a12d Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Mon, 25 Mar 2019 17:39:16 +0900 Subject: [PATCH] Use alternative function for realpath on Win32 --- src/fccfg.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/fccfg.c b/src/fccfg.c index db93118..9f42058 100644 --- a/src/fccfg.c +++ b/src/fccfg.c @@ -87,7 +87,16 @@ FcConfigRealPath(const FcChar8 *path) if (!path) return NULL; +#ifndef _WIN32 resolved_ret = realpath((const char *) path, resolved_name); +#else + if (GetFullPathNameA ((LPCSTR) path, PATH_MAX, resolved_name, NULL) == 0) + { + fprintf (stderr, "Fontconfig warning: GetFullPathNameA failed.\n"); + return NULL; + } + resolved_ret = resolved_name; +#endif if (resolved_ret) path = (FcChar8 *) resolved_ret; return FcStrCopyFilename(path);