{ "lpf", ArgFilename, (void *) &appData.loadPositionFile, FALSE, INVALID },
{ "loadPositionIndex", ArgInt, (void *) &appData.loadPositionIndex, FALSE, (ArgIniType) 1 },
{ "lpi", ArgInt, (void *) &appData.loadPositionIndex, FALSE, INVALID },
+ { "positionDir", ArgFilename, (void *) &appData.positionDir, FALSE, (ArgIniType) "" },
{ "savePositionFile", ArgFilename, (void *) &appData.savePositionFile, FALSE, (ArgIniType) "" },
{ "spf", ArgFilename, (void *) &appData.savePositionFile, FALSE, INVALID },
{ "matchMode", ArgBoolean, (void *) &appData.matchMode, FALSE, (ArgIniType) FALSE },
char fileext[10] = "";
char *result = NULL;
char *cp;
+ char curDir[MSG_SIZ];
+
+ if(def && *def && def[strlen(def)-1] == '/') {
+ getcwd(curDir, MSG_SIZ);
+ chdir(def);
+ }
/* make a copy of the filter string, so that strtok can work with it*/
cp = strdup(filter);
gtk_widget_destroy (dialog);
ModeHighlight();
+ if(def && *def && def[strlen(def)-1] == '/') chdir(curDir);
+
free(cp);
return;
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