Bug 353

Summary: incorrect escaping of backslashes in strings with hush
Product: Busybox Reporter: Mike Frysinger <vapier>
Component: Standard ComplianceAssignee: unassigned
Status: RESOLVED FIXED    
Severity: enhancement CC: busybox-cvs
Priority: P5    
Version: 1.14.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:
Attachments: Fix

Description Mike Frysinger 2009-05-28 05:14:56 UTC
if we do:
f="a\nb\nc\n"
echo "$f"
printf "$f"

we should first see:
a\nb\nc\n

and then:
a
b
c

but with hush, we get:
a\\nb\\nc\\n
a\nb\nc\n
Comment 1 Mike Frysinger 2009-05-28 05:30:40 UTC
i tried tweaking o_addqchr(), but that seems to break the opposite test case:
printf "a\nb\nc\n"
Comment 2 Denys Vlasenko 2009-05-28 14:51:08 UTC
Created attachment 361 [details]
Fix

The bug is in \x handling *in assignments*.

Please try attached patch.
Comment 3 Mike Frysinger 2009-05-28 21:12:27 UTC
seems to do the trick, thanks