diff options
author | Jilles Tjoelker <jilles@stack.nl> | 2011-03-10 17:16:13 +0800 |
---|---|---|
committer | maximilian attems <max@stro.at> | 2011-06-03 18:44:13 +0200 |
commit | 182b6bcb78b64dd2a8a7878e05bf157c3650ba6b (patch) | |
tree | b2e1bdc03a432d954d6842b70ed8c6c78b0bbb51 | |
parent | 0be57ce9e78edf56df46cb1ca64a22cafbbb79c6 (diff) | |
download | klibc-182b6bcb78b64dd2a8a7878e05bf157c3650ba6b.tar.gz |
[klibc] [EXPAND] Do not split the result of tilde expansion
A tilde expansion generates a valid pathname. Splitting it using IFS
either leaves it unchanged or changes it to something unintended.
This fixes FreeBSD sh test expansion/tilde1.0 and does not change the
outcome of the other tests.
This fixes Debian bug #601096.
Example:
IFS=m HOME=/tmp; printf "%s\n" ~
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r-- | usr/dash/expand.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/usr/dash/expand.c b/usr/dash/expand.c index b38c746859f27..900d8c7e6ae2b 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -364,7 +364,6 @@ exptilde(char *startp, char *p, int flag) char *name; const char *home; int quotes = flag & QUOTES_ESC; - int startloc; name = p + 1; @@ -393,9 +392,7 @@ done: if (!home || !*home) goto lose; *p = c; - startloc = expdest - (char *)stackblock(); strtodest(home, SQSYNTAX, quotes); - recordregion(startloc, expdest - (char *)stackblock(), 0); return (p); lose: *p = c; |