Also search indirection files in user's .xboard tree
authorH.G. Muller <h.g.muller@hccnet.nl>
Sun, 2 Mar 2014 19:45:57 +0000 (20:45 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Sun, 2 Mar 2014 20:34:59 +0000 (21:34 +0100)
args.h

diff --git a/args.h b/args.h
index 29308b5..f52404f 100644 (file)
--- a/args.h
+++ b/args.h
@@ -913,11 +913,16 @@ ParseSettingsFile(char *name, char **addr)
   if (ok) {
     f = fopen(fullname, "r");
 #ifdef DATADIR
-    if(f == NULL && *fullname != '/') {         // when a relative name did not work
+    if(f == NULL && *fullname != '/' && !addr) {         // when a relative name did not work
        char buf[MSG_SIZ];
-       snprintf(buf, MSG_SIZ, "%s/themes/conf", DATADIR);
-       MySearchPath(buf, name, fullname); // also look in standard place
+       snprintf(buf, MSG_SIZ, "~/.xboard/themes/conf/%s", name);
+       MySearchPath(installDir, buf, fullname); // first look in user's own files
        f = fopen(fullname, "r");
+       if(f == NULL) {
+           snprintf(buf, MSG_SIZ, "%s/themes/conf", DATADIR);
+           MySearchPath(buf, name, fullname); // also look in standard place
+           f = fopen(fullname, "r");
+       }
     }
 #endif
     if (f != NULL) {