Bug 865 - HUSH: read does not use more than one argument
Summary: HUSH: read does not use more than one argument
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: 1.15.x
Hardware: All Linux
: P5 enhancement
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-12 11:13 UTC by Mikel Garai
Modified: 2010-01-30 23:15 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
patch to add multiple argument to builtin read of HUSH (1.86 KB, patch)
2010-01-12 11:13 UTC, Mikel Garai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikel Garai 2010-01-12 11:13:48 UTC
Created attachment 901 [details]
patch to add multiple argument to builtin read of HUSH

The hush's builtin read does not accept more than one argument, I just did a patch to enable this feature (attached here).

There are some limitations in this patch:
1) it ignores escape sequences
2) it does not use $IFS (I first use the global variable G.ifs but i did have issues in blackfin architecture with the simple command "echo a | read a" and similars that raised a NULL pointer error)

This patch also fixes a bug of builtin read that did not return >0 when stdin was closed, for using read in commands of type "cat XXX | ( while read a b ; do ... ; done )"
Comment 1 Denys Vlasenko 2010-01-12 11:57:33 UTC
I propose adapting and reusing (sharing) ash's readcmd() code. It is a bit more work, but ash's read is well debugged and supports options like timeouts, max chars and so on.
Comment 2 Denys Vlasenko 2010-01-30 23:15:36 UTC
Fixed in 1.16.0