summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2018-09-30 01:54:29 +0000
committerEduard Braun <eduard.braun2@gmx.de>2018-09-30 01:54:29 +0000
commitfdce285ef6b941bc92ad2bd33be3ef015fbd049d (patch)
tree2a95cda269f753f3eda52c2b04bf9e5c746b7360 /src
parentIcons: Fix object-flip-vertical.svg (diff)
downloadinkscape-fdce285ef6b941bc92ad2bd33be3ef015fbd049d.tar.gz
inkscape-fdce285ef6b941bc92ad2bd33be3ef015fbd049d.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/path-prefix.cpp4
1 files changed, 4 insertions, 0 deletions
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);