int\r
MySearchPath(char *installDir, char *name, char *fullname)\r
{\r
- char *dummy;\r
- if(name[0] == '~' && name[1] == '\\') { // [HGM] recognize ~ as HOMEPATH environment variable\r
- installDir = getenv("HOMEPATH");\r
- name += 2;\r
- strcpy(fullname, installDir);\r
- strcat(fullname, "\\");\r
- strcat(fullname, name);\r
+ char *dummy, buf[MSG_SIZ];\r
+ if(name[0] == '%' && strchr(name+1, '%')) { // [HGM] recognize %*% as environment variable\r
+ strcpy(buf, name+1);\r
+ *strchr(buf, '%') = 0;\r
+ installDir = getenv(buf);\r
+ sprintf(fullname, "%s\\%s", installDir, strchr(name+1, '%')+1);\r
return strlen(fullname);\r
}\r
return (int) SearchPath(installDir, name, NULL, MSG_SIZ, fullname, &dummy);\r