From: H.G.Muller Date: Tue, 3 Jan 2017 11:59:46 +0000 (+0100) Subject: Diversify UCI string options into -string, -path and -file X-Git-Tag: v4.0~36 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=734efe5910e2696b2fe52370758d888998377142;p=uci2wb.git Diversify UCI string options into -string, -path and -file Heuristics is applied to the option name, in order to guess whether UCI string options are filenames or directory paths. In which case they are translated into CECP -file and -path options, so XBoard will give them the appropriate browse button. --- diff --git a/UCI2WB.c b/UCI2WB.c index ebcd79c..2db1424 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -358,6 +358,10 @@ Engine2GUI() sprintf(buf, ",%s,", name); if(strcasestr(EGT, buf)) { buf[strlen(buf)-5] = 0; strcat(egts, buf); continue; } // collect EGT formats // pass on engine-defined option as WB option feature if(!strcmp(type, "filename")) type[4] = 0; + else if(sc == 'c' && !strcmp(type, "string")) { // in UCI try to guess which strings are file or directory names + if(strcasestr(name, "file")) strcpy(type, "file"); else + if(strcasestr(name, "path") || strcasestr(name, "directory") || strcasestr(name, "folder")) strcpy(type, "path"); + } sprintf(buf, "feature option=\"%s -%s", name, type); q = buf + strlen(buf); if( !strcmp(type, "file") || !strcmp(type, "string")) sprintf(q, " %s\"\n", val);