diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 4 | ||||
-rw-r--r-- | shell/ash_test/ash-vars/var-expand-tilde-in-parameter-expansion.right | 1 | ||||
-rwxr-xr-x | shell/ash_test/ash-vars/var-expand-tilde-in-parameter-expansion.tests | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c index a81922add..4c43f1f30 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; diff --git a/shell/ash_test/ash-vars/var-expand-tilde-in-parameter-expansion.right b/shell/ash_test/ash-vars/var-expand-tilde-in-parameter-expansion.right new file mode 100644 index 000000000..2357750c5 --- /dev/null +++ b/shell/ash_test/ash-vars/var-expand-tilde-in-parameter-expansion.right @@ -0,0 +1 @@ +:/root diff --git a/shell/ash_test/ash-vars/var-expand-tilde-in-parameter-expansion.tests b/shell/ash_test/ash-vars/var-expand-tilde-in-parameter-expansion.tests new file mode 100755 index 000000000..6605315d0 --- /dev/null +++ b/shell/ash_test/ash-vars/var-expand-tilde-in-parameter-expansion.tests @@ -0,0 +1,2 @@ +a=~root:~root +echo ${a#~root} |