From 754f4657cda73459969668b338d20def501dc102 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 4 Dec 2014 22:20:30 +0100 Subject: [PATCH] pass workdir with environment variable, because passing it from arguments doesn't work if the path has a space. --- build/macos/environment.sh | 3 ++- gtk/main.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build/macos/environment.sh b/build/macos/environment.sh index 3b9ff16af..b466fecc4 100644 --- a/build/macos/environment.sh +++ b/build/macos/environment.sh @@ -1,4 +1,5 @@ -export EXTRA_ARGS="--workdir $bundle_res" +#export EXTRA_ARGS="--workdir $bundle_res" +export LINPHONE_WORKDIR="$bundle_res" export GIO_EXTRA_MODULES="$bundle_lib/gio/modules" export PANGO_LIBDIR="$bundle_lib" export PANGO_SYSCONFDIR="$bundle_etc" diff --git a/gtk/main.c b/gtk/main.c index ea3078c9a..1a582ebd8 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -2101,6 +2101,7 @@ int main(int argc, char *argv[]){ LpConfig *factory; const char *db_file; GError *error=NULL; + const char *tmp; #if !GLIB_CHECK_VERSION(2, 31, 0) g_thread_init(NULL); @@ -2110,6 +2111,8 @@ int main(int argc, char *argv[]){ progpath = strdup(argv[0]); config_file=linphone_gtk_get_config_file(NULL); + + workingdir= (tmp=g_getenv("LINPHONE_WORKDIR")) ? g_strdup(tmp) : NULL; #ifdef WIN32 /*workaround for windows: sometimes LANG is defined to an integer value, not understood by gtk */