make sure the \ gets written for all escapes, not just octals

This commit is contained in:
Bill Currie 2007-10-13 07:14:47 +00:00 committed by Jeff Teunissen
parent 3b906fa5f1
commit 5294a97d6a

View file

@ -873,6 +873,7 @@ write_string (dstring_t *dstr, const char *str)
continue;
}
if (*str) {
*dst++ = '\\';
switch (*str) {
case '\"':
case '\\':
@ -900,7 +901,6 @@ write_string (dstring_t *dstr, const char *str)
*dst++ = 'v';
break;
default:
*dst++ = '\\';
*dst++ = '0' + ((((byte) *str) >> 6) & 3);
*dst++ = '0' + ((((byte) *str) >> 3) & 7);
*dst++ = '0' + (((byte) *str) & 7);