X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xaw%2Fxboard.c;fp=xaw%2Fxboard.c;h=ca3c380fdc03c0108689a7484bab1be4e57af8c4;hb=6d626a70206cc3ad3f5ea665299c762e1013042e;hp=bed61e54295c109a6138853abefc3dc827564851;hpb=b0cd2c1c921fde42bcacfd5363e3b319eada846c;p=xboard.git diff --git a/xaw/xboard.c b/xaw/xboard.c index bed61e5..ca3c380 100644 --- a/xaw/xboard.c +++ b/xaw/xboard.c @@ -2492,6 +2492,19 @@ FrameDelay (int time) #endif +static int +FindLogo (char *place, char *name, char *buf) +{ // check if file exists in given place + FILE *f; + if(!place) return 0; + snprintf(buf, MSG_SIZ, "%s/%s.png", place, name); + if(*place && strcmp(place, ".") && (f = fopen(buf, "r")) ) { + fclose(f); + return 1; + } + return 0; +} + static void LoadLogo (ChessProgramState *cps, int n, Boolean ics) { @@ -2502,7 +2515,11 @@ LoadLogo (ChessProgramState *cps, int n, Boolean ics) if(ics) { // [HGM] logo: in ICS mode second can be used for ICS sprintf(buf, "%s/%s.png", appData.logoDir, appData.icsHost); } else if(appData.logoDir && appData.logoDir[0]) { - sprintf(buf, "%s/%s.png", appData.logoDir, cps->tidy); + } else { // engine; cascade + if(!FindLogo(appData.logoDir, cps->tidy, buf) && // first try user log folder + !FindLogo(appData.directory[n], "logo", buf) && // then engine directory + !FindLogo("/usr/localshare/games/plugins/logos", cps->tidy, buf) ) // then system folders + FindLogo("/usr/share/games/plugins/logos", cps->tidy, buf); } } if(logoName[0])