Diversify UCI string options into -string, -path and -file
[uci2wb.git] / UCI2WB.c
index ebcd79c..2db1424 100644 (file)
--- 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\r
            // pass on engine-defined option as WB option feature\r
            if(!strcmp(type, "filename")) type[4] = 0;\r
+           else if(sc == 'c' && !strcmp(type, "string")) { // in UCI try to guess which strings are file or directory names\r
+               if(strcasestr(name, "file")) strcpy(type, "file"); else\r
+               if(strcasestr(name, "path") || strcasestr(name, "directory") || strcasestr(name, "folder")) strcpy(type, "path");\r
+           }\r
            sprintf(buf, "feature option=\"%s -%s", name, type); q = buf + strlen(buf);\r
            if(     !strcmp(type, "file")\r
                 || !strcmp(type, "string")) sprintf(q, " %s\"\n", val);\r