Bug 883

Summary: HUSH: syntax error on correct script
Product: Busybox Reporter: Mikel Garai <m.garai>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: enhancement CC: busybox-cvs
Priority: P5    
Version: 1.15.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

Description Mikel Garai 2010-01-12 11:44:57 UTC
Hi (again :-) ),

Hush does complain about a syntax error in the following script:

echo a | ( if true; then echo $(echo a); fi )

hush: syntax error: unterminated )

and both dash and bash do not complain about it.

if this script is written in the following way it does not complain:

echo a | ( if true; then echo `echo a`; fi )

thanks,

Mikel Garai
Comment 1 Denys Vlasenko 2010-01-12 12:18:27 UTC
Fix:


--- busybox.8/shell/hush.c      2010-01-12 11:56:36.000000000 +0100
+++ busybox.9/shell/hush.c      2010-01-12 13:16:47.980233239 +0100
@@ -5986,7 +5986,7 @@ static int handle_dollar(o_string *as_st
 #  if !BB_MMU
                if (as_string) {
                        o_addstr(as_string, dest->data + pos);
-                       o_addchr(as_string, '`');
+                       o_addchr(as_string, ')');
                }
 #  endif
                o_addchr(dest, SPECIAL_VAR_SYMBOL);
Comment 2 Mikel Garai 2010-01-12 14:42:24 UTC
Wow! that's fast!


I just tested it and it works.

thank you very much,

Mikel Garai
Comment 3 Denys Vlasenko 2010-01-30 23:14:53 UTC
Fixed in 1.16.0