hush: fix a=abc; c=c; echo ${a%${c}}
function old new delta
expand_vars_to_list 2229 2302 +73
add_till_closing_paren 286 313 +27
handle_dollar 623 574 -49
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 100/-49) Total: 51 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/shell/hush_test/hush-vars/var3.right b/shell/hush_test/hush-vars/var3.right
index 5e28d2f..40e67fd 100644
--- a/shell/hush_test/hush-vars/var3.right
+++ b/shell/hush_test/hush-vars/var3.right
@@ -1,2 +1,2 @@
-hush: syntax error: unterminated ${name}
+hush: invalid number '1q'
hush: syntax error: unterminated ${name}
diff --git a/shell/hush_test/hush-vars/var_posix1.right b/shell/hush_test/hush-vars/var_posix1.right
index e6cba27..813437e 100644
--- a/shell/hush_test/hush-vars/var_posix1.right
+++ b/shell/hush_test/hush-vars/var_posix1.right
@@ -23,6 +23,7 @@
ababcdcd
Empty:
ababcdcd}_tail
+ababcdcd_tail
ababcd
ababcd
ababcd
@@ -32,5 +33,8 @@
ababcdcd
Empty:
ababcdcd}_tail
+ababcdcd_tail
ababcdcd
-end
+ab
+ab
+End
diff --git a/shell/hush_test/hush-vars/var_posix1.tests b/shell/hush_test/hush-vars/var_posix1.tests
index c1f6409..e48fd98 100755
--- a/shell/hush_test/hush-vars/var_posix1.tests
+++ b/shell/hush_test/hush-vars/var_posix1.tests
@@ -31,7 +31,7 @@
echo ${var#*}
echo Empty:${var##*}
echo ${var#}}_tail
-# UNFIXED BUG: echo ${var#\}}_tail
+echo ${var#\}}_tail
echo ${var%cd}
echo ${var%%cd}
@@ -42,7 +42,10 @@
echo ${var%*}
echo Empty:${var%%*}
echo ${var#}}_tail
-# UNFIXED BUG: echo ${var#\}}_tail
+echo ${var#\}}_tail
echo ${var%\\*}
-echo end
+a=ab}; echo ${a%\}};
+a=abc; c=c; echo ${a%${c}}
+
+echo End