Bug 865

Summary: HUSH: read does not use more than one argument
Product: Busybox Reporter: Mikel Garai <m.garai>
Component: Standard ComplianceAssignee: unassigned
Status: RESOLVED FIXED    
Severity: enhancement CC: busybox-cvs
Priority: P5    
Version: 1.15.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:
Attachments: patch to add multiple argument to builtin read of HUSH

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