From dd721f71292be8ae2ef0ac1d2d8910b1541dcf88 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Mon, 24 Sep 2007 16:22:25 +0800 Subject: [EXPAND] Perform tilde expansion in all parameter expansion words Previously tilde expansion was not carried out for =?#% expansion words. This is contrary to the POSIX specification. Test case: a=~root:~root echo ${a#~root} Old result: /root:/root New result: :/root --- src/expand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/expand.c') diff --git a/src/expand.c b/src/expand.c index 3956112..1443c14 100644 --- a/src/expand.c +++ b/src/expand.c @@ -683,7 +683,8 @@ subevalvar(char *p, char *str, int strloc, int subtype, int startloc, int varfla char *(*scan)(char *, char *, char *, char *, int , int); herefd = -1; - argstr(p, subtype != VSASSIGN && subtype != VSQUESTION ? EXP_CASE : 0); + argstr(p, EXP_TILDE | (subtype != VSASSIGN && subtype != VSQUESTION ? + EXP_CASE : 0)); STPUTC('\0', expdest); herefd = saveherefd; argbackq = saveargbackq; -- cgit 1.4.1