Bug 353 - incorrect escaping of backslashes in strings with hush
Summary: incorrect escaping of backslashes in strings with hush
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: 1.14.x
Hardware: PC Linux
: P5 enhancement
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-28 05:14 UTC by Mike Frysinger
Modified: 2009-05-28 21:12 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
Fix (4.39 KB, patch)
2009-05-28 14:51 UTC, Denys Vlasenko
Details

Note You need to log in before you can comment on or make changes to this bug.
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