| Summary: | ash: incorrect word splitting with read builtin | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Harald van Dijk <truedfx> |
| Component: | Standard Compliance | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | 1.13.x | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: |
Fix
Fix for the problem described in comment #6 |
||
|
Description
Harald van Dijk
2009-03-30 17:31:16 UTC
Thanks for reporting it here. Of interest to whoever decides to look at this bug. http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_05 http://www.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_22_02_06_05 Created attachment 223 [details]
Fix
Try attached patch
Nice, I played with it a bit and it didn't break. It gives the results I expect. same bug probably exists in hush ;) hush's read simply doesn't do word splitting at all. According to http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_05 (provided I interpret it correctly) the following printf '\t,\ta\t,\tb\tc' | ash -c 'IFS=$(printf " \t,") read a b c d; echo ".$a. .$b. .$c. .$d."' should result in: .. .a. .b. .c. In version 1.15.3 it however results in: .a. .b. .c. .. The fix-patch from this ticket introduced the bug. Patch with fix and some test cases attached. Created attachment 879 [details] Fix for the problem described in comment #6 Fixed in git, thanks! |