Allow \0ooo octal escapes
Yeah well, the old topic. POSIX allows \0123 and \123 octals in different tools, in printf, depending on %b or other things. We'll just keep it simple and just allow 4 digits. the 0 does not make a difference anyway.
This commit is contained in:
parent
bbacab561c
commit
41a600e1b8
|
@ -51,8 +51,8 @@ unescape(char *s)
|
||||||
case '\0':
|
case '\0':
|
||||||
eprintf("%s: null escape sequence\n", argv0);
|
eprintf("%s: null escape sequence\n", argv0);
|
||||||
default:
|
default:
|
||||||
/* "\O[OO]" octal escape */
|
/* "\O[OOO]" octal escape */
|
||||||
for (m = i + 1; m < i + 1 + 3 && m < len; m++)
|
for (m = i + 1; m < i + 1 + 4 && m < len; m++)
|
||||||
if (s[m] < '0' || s[m] > '7')
|
if (s[m] < '0' || s[m] > '7')
|
||||||
break;
|
break;
|
||||||
if (m == i + 1)
|
if (m == i + 1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user