X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=menus.c;h=9ddfbada41e88e0729df9a8174aade172adefed3;hb=ba12e63149a003b88b8525d6eb50d48539c660b6;hp=4934a3c1ebf055e794100f5a8b547a4e53ca5b12;hpb=2987ec348b8b2cbf38ba9a6a0793652a6b238ae8;p=xboard.git diff --git a/menus.c b/menus.c index 4934a3c..9ddfbad 100644 --- a/menus.c +++ b/menus.c @@ -105,6 +105,7 @@ extern char *getenv(); char *gameCopyFilename, *gamePasteFilename; Boolean saveSettingsOnExit; char *settingsFileName; +char gamesDir[MSG_SIZ], positionsDir[MSG_SIZ], textureDir[MSG_SIZ], bookDir[MSG_SIZ], piecesDir[MSG_SIZ]; static int LoadGamePopUp (FILE *f, int gameNumber, char *title) @@ -173,10 +174,12 @@ ReloadPositionProc () void LoadPositionProc() { + static char buf[MSG_SIZ]; if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { Reset(FALSE, TRUE); } - FileNamePopUp(_("Load position file name?"), "", ".fen .epd .pos", LoadPosition, "rb"); + snprintf(buf, MSG_SIZ, "%s/", appData.positionDir); + FileNamePopUp(_("Load position file name?"), buf, ".fen .epd .pos", LoadPosition, "rb"); } void @@ -313,7 +316,7 @@ void InfoProc () { char buf[MSG_SIZ]; -#ifdef __APPLE__ +#ifdef OSXAPP snprintf(buf, MSG_SIZ, "%s ./info.command", appData.sysOpen); #else snprintf(buf, sizeof(buf), "xterm -e info --directory %s --directory . -f %s &", @@ -1176,6 +1179,7 @@ InstallNewEngine (char *command, char *dir, char *variants, char *protocol) snprintf(buf + strlen(buf), MSG_SIZ - strlen(buf), " -fd %s", dir); if(!strcmp(protocol, "uci")) snprintf(buf + strlen(buf), MSG_SIZ - strlen(buf), " -fUCI"); + if(strstr(firstChessProgramNames, buf)) return; // avoid duplicats // append line quote = malloc(strlen(firstChessProgramNames) + strlen(buf) + 2); sprintf(quote, "%s%s\n", firstChessProgramNames, buf);