summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@stack.nl>2011-03-10 17:16:13 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2011-03-10 17:16:13 +0800
commit834629283f6c629a4da05ef60bae9445c954a19a (patch)
treee84d346c3225c2cc1dc46dda2e2c5c1ae03369bd /src
parent[REDIR] Replace GPL noclobberopen code with the FreeBSD version (diff)
downloaddash-834629283f6c629a4da05ef60bae9445c954a19a.tar.gz
dash-834629283f6c629a4da05ef60bae9445c954a19a.zip
[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>
Diffstat (limited to 'src')
-rw-r--r--src/expand.c3
1 files changed, 0 insertions, 3 deletions
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;
r> 2020-09-11Rewrite install script yet againJune McEnroe 2020-09-11Remove NetBSD from install scriptJune McEnroe I never use it. 2020-09-11Use MacPorts rather than pkgsrcJune McEnroe My system is probably such a mess now... 2020-09-11Add debian VM name to sshJune McEnroe 2020-09-11Add influencer tweetJune McEnroe 2020-09-10Add The Kingdom of GodsJune McEnroe Reading has really slowed down :( 2020-09-07Add SunglassesJune McEnroe An IRC find. 2020-09-06Add Between the BreathsJune McEnroe One of those good songs from a soundtrack of a film that probably isn't? The summary sounds a lot more interesting than the title implies, at least. 2020-09-04Open /dev/tty in nudgeJune McEnroe This makes it work even when it's run connected to a pipe, i.e. as the notify command of catgirl... 2020-09-04Add nudgeJune McEnroe 2020-09-03Build fbclock with -lzJune McEnroe I guess this got lost somewhere, long ago... 2020-08-29Add tweets from retweetsJune McEnroe