From 834629283f6c629a4da05ef60bae9445c954a19a Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Thu, 10 Mar 2011 17:16:13 +0800 Subject: [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 --- src/expand.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/expand.c b/src/expand.c index 1b77b7c..6bee5c5 100644 --- a/src/expand.c +++ b/src/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; -- cgit 1.4.1