summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 190cdab)
raw | patch | inline | side by side (parent: 190cdab)
author | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Tue, 30 Mar 2010 16:05:21 +0000 (18:05 +0200) | ||
committer | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Tue, 30 Mar 2010 16:05:21 +0000 (18:05 +0200) |
src/main.cpp | patch | blob | history |
diff --git a/src/main.cpp b/src/main.cpp
index cd60d9fa16f80c33dc8c4327fc227d1b9d548114..32102f3b3b7b75fa4254be03e21d9f7b173c5deb 100644 (file)
--- a/src/main.cpp
+++ b/src/main.cpp
#else
extdir = g_strdup(INKSCAPE_EXTENSIONDIR);
#endif
+
+ // On some platforms, INKSCAPE_EXTENSIONDIR is not absolute,
+ // but relative to the directory that contains the Inkscape executable.
+ // Since we spawn Python chdir'ed into the script's directory,
+ // we need to obtain the absolute path here.
+ if (!g_path_is_absolute(extdir)) {
+ gchar *curdir = g_get_current_dir();
+ gchar *extdir_new = g_build_filename(curdir, extdir, NULL);
+ g_free(extdir);
+ g_free(curdir);
+ extdir = extdir_new;
+ }
+
if (pythonpath) {
new_pythonpath = g_strdup_printf("%s" G_SEARCHPATH_SEPARATOR_S "%s",
extdir, pythonpath);
g_setenv("PYTHONPATH", new_pythonpath, TRUE);
g_free(new_pythonpath);
- printf("PYTHONPATH = %s", g_getenv("PYTHONPATH"));
+ printf("PYTHONPATH = %s\n", g_getenv("PYTHONPATH"));
}
/**
HKCR\svgfile\shell\open\command is a good example
TODO: this breaks the CLI on Windows, see LP #167455
- However, the CLI is broken anyway, because we are a GUI app
*/
const int pathbuf = 2048;
gunichar2 *path = g_new(gunichar2, pathbuf);