From: H.G. Muller Date: Fri, 12 Nov 2010 16:02:53 +0000 (+0100) Subject: Restrict use of escape expansion X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=6fc36efaa39c45911689000cfe10fd5c60aaf21b;p=xboard.git Restrict use of escape expansion Only expand escape sequences like \n and \t in telluser(error) comamnds that ask for it by preficing the messages by double backslash. Otherwise backward copatiblity is too severely broken for messages that display DOS-style filenames. --- diff --git a/backend.c b/backend.c index 46a14c7..bd4bd75 100644 --- a/backend.c +++ b/backend.c @@ -7488,13 +7488,15 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats. * Look for communication commands */ if (!strncmp(message, "telluser ", 9)) { - EscapeExpand(message+9, message+9); // [HGM] esc: allow escape sequences in popup box + if(message[9] == '\\' && message[10] == '\\') + EscapeExpand(message+9, message+11); // [HGM] esc: allow escape sequences in popup box DisplayNote(message + 9); return; } if (!strncmp(message, "tellusererror ", 14)) { cps->userError = 1; - EscapeExpand(message+14, message+14); // [HGM] esc: allow escape sequences in popup box + if(message[14] == '\\' && message[15] == '\\') + EscapeExpand(message+14, message+16); // [HGM] esc: allow escape sequences in popup box DisplayError(message + 14, 0); return; }