Fix msg_check_escapes() so it allows escaped backslashes.

If a valid escape (\n, \s, or \\) is found, increment the pointer
marking the start of the next search so we don't start looking at the
escaped character. The old behaviour was a problem for messages
containing slashes -- the escaped slash would be looked at in the next
pass and so the following character would be treated as an escape,
causing the message to be dropped for having "an invalid ADC escape".
This commit is contained in:
Blair Bonnett 2012-09-17 15:10:23 +12:00
parent b0aa690cb4
commit 3f777ce5e2

View File

@ -76,6 +76,12 @@ static int msg_check_escapes(const char* string, size_t len)
case '\\': case '\\':
case 'n': case 'n':
case 's': case 's':
/* Increment so we don't check the escaped
* character next time around. Not doing so
* leads to messages with escaped backslashes
* being incorrectly reported as having invalid
* escapes. */
++start;
break; break;
default: default:
return 0; return 0;