(svn r13992) -Fix [FS#2189]: the dedicated console removed any character that was not a printable ASCII character instead. Now it allows UTF8 formated strings too.

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
rubidium 16 years ago
parent 8fba4705f0
commit 6c5f703cf0

@ -230,21 +230,16 @@ static void DedicatedHandleKeyInput()
SetEvent(_hWaitForInputHandling); SetEvent(_hWaitForInputHandling);
#endif #endif
/* XXX - strtok() does not 'forget' \n\r if it is the first character! */ /* strtok() does not 'forget' \r\n if the string starts with it,
strtok(input_line, "\r\n"); // Forget about the final \n (or \r) * so we have to manually remove that! */
{ /* Remove any special control characters */ strtok(input_line, "\r\n");
uint i; for (char *c = input_line; *c != '\0'; c++) {
for (i = 0; i < lengthof(input_line); i++) { if (*c == '\n' || *c == '\r' || c == lastof(input_line)) {
if (input_line[i] == '\n' || input_line[i] == '\r') // cut missed beginning '\0' *c = '\0';
input_line[i] = '\0'; break;
if (input_line[i] == '\0')
break;
if (!IsInsideMM(input_line[i], ' ', 256))
input_line[i] = ' ';
} }
} }
str_validate(input_line);
IConsoleCmdExec(input_line); // execute command IConsoleCmdExec(input_line); // execute command
} }

Loading…
Cancel
Save