From 6432014c48da91b241816d8d97c1ec76bee305c8 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Wed, 24 Aug 2011 09:51:10 +0200 Subject: [PATCH] Fix quoting in Load Engine dialog 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. --- backend.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/backend.c b/backend.c index 12931a7..ebe010e 100644 --- a/backend.c +++ b/backend.c @@ -907,8 +907,8 @@ Load(ChessProgramState *cps, int i) 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; } -- 1.7.0.4