aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2011-03-10 20:59:46 +0800
committermaximilian attems <max@stro.at>2011-06-03 18:44:13 +0200
commite79a89772db804b4800a896e79c2300f1d4f735c (patch)
treefb16952a4afd88380af7be617dcf140bf5ead329
parent932d5e0144e678cf97c21e34368d5a281ef8b11a (diff)
downloadklibc-e79a89772db804b4800a896e79c2300f1d4f735c.tar.gz
[klibc] [BUILTIN] Fix CTLESC clobbering by read(1)
The changeset 55c46b7286f5d9f2d8291158203e2b61d2494420 [BUILTIN] Honor tab as IFS whitespace when splitting fields in readcmd uses CTLESC to prevent field splitting in read(1). However, it did not escape CTLESC itself in the input stream. This patch adds the necessary CTLESC characters so that CTLESC isn't corrupted. Reported-by: Alexey Gladkov <gladkov.alexey@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r--usr/dash/miscbltin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr/dash/miscbltin.c b/usr/dash/miscbltin.c
index 152337b9897f9..f2acce8a03a94 100644
--- a/usr/dash/miscbltin.c
+++ b/usr/dash/miscbltin.c
@@ -233,7 +233,7 @@ readcmd(int argc, char **argv)
}
if (c == '\0')
continue;
- if (backslash) {
+ if (backslash || c == CTLESC) {
if (c == '\n')
goto resetbs;
STPUTC(CTLESC, p);