sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

commit 41a600e1b8856a6710524f56470b592700d1899f
parent bbacab561ce953c1e4620d5a42334ca9e9701331
Author: FRIGN <dev@frign.de>
Date:   Sat, 20 Feb 2016 21:40:11 +0100

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.

Diffstat:
Mlibutil/unescape.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libutil/unescape.c b/libutil/unescape.c @@ -51,8 +51,8 @@ unescape(char *s) case '\0': eprintf("%s: null escape sequence\n", argv0); default: - /* "\O[OO]" octal escape */ - for (m = i + 1; m < i + 1 + 3 && m < len; m++) + /* "\O[OOO]" octal escape */ + for (m = i + 1; m < i + 1 + 4 && m < len; m++) if (s[m] < '0' || s[m] > '7') break; if (m == i + 1)