From 3df47f9cbbb7f16608cbc642026625cdf7f06aa9 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 18 May 2015 09:53:26 +0200 Subject: ash: do not expand tilde in parameter expansion within quotes Test case: unset a echo "${a:-~root}" Old result: /root New result: ~root Based on commit 170f44d from git://git.kernel.org/pub/scm/utils/dash/dash.git by Herbert Xu function old new delta evalvar 598 604 +6 parse_command 1440 1443 +3 localcmd 325 327 +2 readtoken1 3199 3200 +1 argstr 1180 1164 -16 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/1 up/down: 12/-16) Total: -4 bytes Signed-off-by: Ron Yorston Signed-off-by: Denys Vlasenko --- .../var-do-not-expand-tilde-in-parameter-expansion-in-quotes.right | 1 + .../var-do-not-expand-tilde-in-parameter-expansion-in-quotes.tests | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 shell/ash_test/ash-vars/var-do-not-expand-tilde-in-parameter-expansion-in-quotes.right create mode 100755 shell/ash_test/ash-vars/var-do-not-expand-tilde-in-parameter-expansion-in-quotes.tests (limited to 'shell/ash_test/ash-vars') diff --git a/shell/ash_test/ash-vars/var-do-not-expand-tilde-in-parameter-expansion-in-quotes.right b/shell/ash_test/ash-vars/var-do-not-expand-tilde-in-parameter-expansion-in-quotes.right new file mode 100644 index 0000000..4b9b4f0 --- /dev/null +++ b/shell/ash_test/ash-vars/var-do-not-expand-tilde-in-parameter-expansion-in-quotes.right @@ -0,0 +1 @@ +~root diff --git a/shell/ash_test/ash-vars/var-do-not-expand-tilde-in-parameter-expansion-in-quotes.tests b/shell/ash_test/ash-vars/var-do-not-expand-tilde-in-parameter-expansion-in-quotes.tests new file mode 100755 index 0000000..d8eb8fc --- /dev/null +++ b/shell/ash_test/ash-vars/var-do-not-expand-tilde-in-parameter-expansion-in-quotes.tests @@ -0,0 +1,2 @@ +unset a +echo "${a:-~root}" -- cgit v1.1