}
if ((chessDir = (char *) getenv("CHESSDIR")) == NULL) {
- chessDir = ".";
+ static char dirName[MSG_SIZ];
+ getcwd(dirName, MSG_SIZ);
+ chessDir = dirName;
} else {
if (chdir(chessDir) != 0) {
fprintf(stderr, _("%s: can't cd to CHESSDIR: "), programName);
extern int useImages, useImageSqs;
extern char ICSInputTranslations[];
extern char *selected_fen_position;
+extern char *chessDir;
#define TOPLEVEL 1 /* preference item; 1 = make popup windows toplevel */
GtkFileFilter *gtkfilter_all;
int n, opt_i = (intptr_t) gdata;
GtkFileChooserAction fc_action;
- char buf[MSG_SIZ];
+ char buf[MSG_SIZ], *p;
gtkfilter = gtk_file_filter_new();
gtkfilter_all = gtk_file_filter_new();
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
NULL);
+ if(*chessDir && (!(p = strstr(chessDir, "/home/")) || strchr(p+6, '/')))
+ gtk_file_chooser_add_shortcut_folder(GTK_FILE_CHOOSER(dialog), chessDir, NULL);
gtk_file_chooser_add_shortcut_folder(GTK_FILE_CHOOSER(dialog), dataDir, NULL);
snprintf(buf, MSG_SIZ, "%s/themes", dataDir);
gtk_file_chooser_add_shortcut_folder(GTK_FILE_CHOOSER(dialog), buf, NULL);