From 2cbc3f167bb47f2580274c8d1456a1e2de38b232 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Krzysztof=20Kosi=C5=84ski?= Date: Tue, 30 Mar 2010 00:22:39 +0200 Subject: [PATCH] More correct setting of PYTHONPATH at startup --- src/Makefile.am | 1 + src/main.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 74bfa01d6..03b58c610 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -186,6 +186,7 @@ EXTRA_DIST = \ extension/internal/emf-win32-print.h \ helper/sp-marshal.list \ show-preview.bmp \ + winconsole.cpp \ $(jabber_whiteboard_SOURCES) \ $(CXXTEST_TEMPLATE) diff --git a/src/main.cpp b/src/main.cpp index a6dfb37f0..cd60d9fa1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -545,18 +545,24 @@ static void set_extensions_env() { gchar const *pythonpath = g_getenv("PYTHONPATH"); gchar *extdir; + gchar *new_pythonpath; #ifdef WIN32 extdir = g_win32_locale_filename_from_utf8(INKSCAPE_EXTENSIONDIR); #else extdir = g_strdup(INKSCAPE_EXTENSIONDIR); #endif + if (pythonpath) { + new_pythonpath = g_strdup_printf("%s" G_SEARCHPATH_SEPARATOR_S "%s", + extdir, pythonpath); + g_free(extdir); + } else { + new_pythonpath = extdir; + } - gchar *new_pythonpath = g_strdup_printf("%s" G_SEARCHPATH_SEPARATOR_S "%s", - extdir, pythonpath); g_setenv("PYTHONPATH", new_pythonpath, TRUE); - g_free(extdir); g_free(new_pythonpath); + printf("PYTHONPATH = %s", g_getenv("PYTHONPATH")); } /** -- 2.30.2