summaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
authorRon Yorston2015-05-18 09:51:35 +0200
committerDenys Vlasenko2015-05-18 09:51:35 +0200
commiteb6b48ba743d510ad9e6f9c3a8b3899d1eb9b5f3 (patch)
tree7db919fa839cfddeae720dccb60f8e969bd5d6c9 /shell/ash.c
parentd68d1fbd6cb31a61975112acb1c792735a063847 (diff)
downloadbusybox-eb6b48ba743d510ad9e6f9c3a8b3899d1eb9b5f3.zip
busybox-eb6b48ba743d510ad9e6f9c3a8b3899d1eb9b5f3.tar.gz
ash: perform tilde expansion in all parameter expansion words
Previously tilde expansion was not carried out for =?#% expansion words. Test case: a=~root:~root echo ${a#~root} Old result: /root:/root New result: :/root Based on commit dd721f71 from git://git.kernel.org/pub/scm/utils/dash/dash.git by Herbert Xu function old new delta subevalvar 1152 1153 +1 Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c
index a81922a..4c43f1f 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -6361,8 +6361,8 @@ subevalvar(char *p, char *varname, int strloc, int subtype,
// p, varname, strloc, subtype, startloc, varflags, quotes);
herefd = -1;
- argstr(p, (subtype != VSASSIGN && subtype != VSQUESTION) ? EXP_CASE : 0,
- var_str_list);
+ argstr(p, EXP_TILDE | (subtype != VSASSIGN && subtype != VSQUESTION ?
+ EXP_CASE : 0), var_str_list);
STPUTC('\0', expdest);
herefd = saveherefd;
argbackq = saveargbackq;