Commit 28bf7186 authored by Patrick Storz's avatar Patrick Storz 🦄

append_inkscape_datadir: Canonicalize inkscape_datadir separately

g_canonicalize_filename() needs the second parameter to be absolute
which INKSCAPE_DATADIR is not guaranteed to be (e.g. when supplied
via environment variable).

(follow up to 812f50f7)
parent 370c52d1
Pipeline #66318948 passed with stages
in 116 minutes and 35 seconds
......@@ -37,18 +37,30 @@ char *append_inkscape_datadir(const char *relative_path)
static gchar const *inkscape_datadir;
if (!inkscape_datadir) {
gchar *datadir;
gchar const *datadir_env = g_getenv("INKSCAPE_DATADIR");
if (datadir_env) {
inkscape_datadir = g_strdup(datadir_env);
datadir = g_strdup(datadir_env);
} else {
#ifdef _WIN32
gchar *module_path = g_win32_get_package_installation_directory_of_module(NULL);
inkscape_datadir = g_build_filename(module_path, "share", NULL);
datadir = g_build_filename(module_path, "share", NULL);
inkscape_datadir = INKSCAPE_DATADIR;
datadir = g_strdup(INKSCAPE_DATADIR);
inkscape_datadir = g_canonicalize_filename(datadir, NULL);
inkscape_datadir = datadir;
if (!relative_path) {
relative_path = "";
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment