From: H.G.Muller Date: Mon, 8 Sep 2014 18:42:11 +0000 (+0200) Subject: Include some conditional OS X fixes X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=8bb10df123593a8ce3221acbd8c668852af5eac1;p=xboard.git Include some conditional OS X fixes DATADIR must be corrected to ~~ in the OS X app, and the info command must be started in a different way. --- diff --git a/args.h b/args.h index 309f653..91de0bf 100644 --- a/args.h +++ b/args.h @@ -1611,10 +1611,17 @@ SaveSettings(char* name) break; case ArgFilename: if(*(char**)ad->argLoc == NULL) break; // just in case - if (strchr(*(char **)ad->argLoc, '\"')) { - fprintf(f, OPTCHAR "%s" SEPCHAR "'%s'\n", ad->argName, *(char **)ad->argLoc); - } else { - fprintf(f, OPTCHAR "%s" SEPCHAR "\"%s\"\n", ad->argName, *(char **)ad->argLoc); + { char buf[MSG_SIZ]; + snprintf(buf, MSG_SIZ, "%s", *(char**)ad->argLoc); +#ifdef __APPLE__ + if(strstr(buf, DATADIR) == buf) + snprintf(buf, MSG_SIZ, "~~%s", *(char**)ad->argLoc + strlen(DATADIR)); +#endif + if (strchr(buf, '\"')) { + fprintf(f, OPTCHAR "%s" SEPCHAR "'%s'\n", ad->argName, buf); + } else { + fprintf(f, OPTCHAR "%s" SEPCHAR "\"%s\"\n", ad->argName, buf); + } } break; case ArgBoardSize: diff --git a/menus.c b/menus.c index 65a154e..b79c90a 100644 --- a/menus.c +++ b/menus.c @@ -313,8 +313,12 @@ void InfoProc () { char buf[MSG_SIZ]; +#ifdef __APPLE__ + snprintf(buf, MSG_SIZ, "%s ./info.command", appData.sysOpen); +#else snprintf(buf, sizeof(buf), "xterm -e info --directory %s --directory . -f %s &", INFODIR, INFOFILE); +#endif system(buf); } @@ -810,7 +814,8 @@ Menu menuBar[] = { {N_("Engine"), "Engine", engineMenu}, {N_("Options"), "Options", optionsMenu}, {N_("Help"), "Help", helpMenu}, - {NULL, NULL, NULL} + {NULL, NULL, NULL}, + { "", "None", noMenu} }; MenuItem *