From fdce285ef6b941bc92ad2bd33be3ef015fbd049d Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 30 Sep 2018 03:54:29 +0200 Subject: Canonicalize path read from INKSCAPE_DATADIR environment variable Most importantly this will ensure an absolute path is used. While relative paths worked in principle some strange WinAPI breakage affected Inkscape's ability to properly treat relative paths in all scenarios. --- src/path-prefix.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/path-prefix.cpp') diff --git a/src/path-prefix.cpp b/src/path-prefix.cpp index 2ef9c4f7d..94945964c 100644 --- a/src/path-prefix.cpp +++ b/src/path-prefix.cpp @@ -43,7 +43,11 @@ char *append_inkscape_datadir(const char *relative_path) if (!inkscape_datadir) { gchar const *datadir_env = g_getenv("INKSCAPE_DATADIR"); if (datadir_env) { +#if GLIB_CHECK_VERSION(2,58,0) + inkscape_datadir = g_canonicalize_filename(datadir_env, NULL); +#else inkscape_datadir = g_strdup(datadir_env); +#endif } else { #ifdef _WIN32 gchar *module_path = g_win32_get_package_installation_directory_of_module(NULL); -- cgit v1.2.3