From c2aa218f23a4e952746ebef7bb86668c6255471c Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 4 Aug 2018 22:25:28 +0200 Subject: ash,hush: properly handle ${v//pattern/repl} if pattern starts with / Closes 2695 function old new delta parse_dollar 762 790 +28 subevalvar 1258 1267 +9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 37/0) Total: 37 bytes Signed-off-by: Denys Vlasenko --- shell/hush_test/hush-vars/var_bash_pattern_starting_with_slash.right | 2 ++ shell/hush_test/hush-vars/var_bash_pattern_starting_with_slash.tests | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 shell/hush_test/hush-vars/var_bash_pattern_starting_with_slash.right create mode 100755 shell/hush_test/hush-vars/var_bash_pattern_starting_with_slash.tests (limited to 'shell/hush_test/hush-vars') diff --git a/shell/hush_test/hush-vars/var_bash_pattern_starting_with_slash.right b/shell/hush_test/hush-vars/var_bash_pattern_starting_with_slash.right new file mode 100644 index 0000000..439dca5 --- /dev/null +++ b/shell/hush_test/hush-vars/var_bash_pattern_starting_with_slash.right @@ -0,0 +1,2 @@ +-dev-ram +/dev-am diff --git a/shell/hush_test/hush-vars/var_bash_pattern_starting_with_slash.tests b/shell/hush_test/hush-vars/var_bash_pattern_starting_with_slash.tests new file mode 100755 index 0000000..b83fb8e --- /dev/null +++ b/shell/hush_test/hush-vars/var_bash_pattern_starting_with_slash.tests @@ -0,0 +1,3 @@ +v=/dev/ram +echo ${v////-} +echo ${v///r/-} -- cgit v1.1