From 7c256e07bc19f67172924d91dce25291ce480988 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 19 Jan 2014 20:27:59 +0100 Subject: [PATCH] Expand %s in -openCommand to DATADIR and fix OSX settings-file name This can be used in OS X to biggy-back a cd to a directory in the App on the open command. --- gtk/xboard.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/gtk/xboard.c b/gtk/xboard.c index ecf36dd..4c66bdc 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -779,7 +779,7 @@ main (int argc, char **argv) GtkosxApplication *theApp = g_object_new(GTKOSX_TYPE_APPLICATION, NULL); char *path = gtkosx_application_get_bundle_path(); strncpy(dataDir, path, MSG_SIZ); - snprintf(masterSettings, MSG_SIZ, "%s/../Resources/etc/xboard.conf", path); + snprintf(masterSettings, MSG_SIZ, "%s/Contents/Resources/etc/xboard.conf", path); g_signal_connect(theApp, "NSApplicationOpenFile", G_CALLBACK(StartNewXBoard), NULL); // we must call application ready before we can get the signal, // and supply a (dummy) menu bar before that, to avoid problems with dual apples in it @@ -848,6 +848,8 @@ main (int argc, char **argv) { // [HGM] initstring: kludge to fix bad bug. expand '\n' characters in init string and computer string. static char buf[MSG_SIZ]; + snprintf(buf, MSG_SIZ, appData.sysOpen, DATADIR); + ASSIGN(appData.sysOpen, buf); // expand %s in -openCommand to DATADIR (usefull for OS X configuring) EscapeExpand(buf, appData.firstInitString); appData.firstInitString = strdup(buf); EscapeExpand(buf, appData.secondInitString); -- 1.7.0.4