A (space-contaning) engine name only needs quoting when there are parameters,
because the over-all engine command will be quoted anyway. For UCI engines
duplicate quoting is fatal, because when passed as the -ec argument of
Polyglot, it will be quoted yet another time, also with double quotes.
appData.directory[i] = strdup(engineName);
p[-1] = SLASH;
} else appData.directory[i] = ".";
- if(strchr(p, ' ') && !strchr(p, '"')) snprintf(buf2, MSG_SIZ, "\"%s\"", p), p = buf2; // quote if it contains spaces
if(params[0]) {
+ if(strchr(p, ' ') && !strchr(p, '"')) snprintf(buf2, MSG_SIZ, "\"%s\"", p), p = buf2; // quote if it contains spaces
snprintf(command, MSG_SIZ, "%s %s", p, params);
p = command;
}