> Sure -print0 required almost no change in the code for find, but it
> requires significant change in any program using the output of find. I
> maintain that shell quoting would have been a much better choice.

 And it would have made non-shell programs a lot more difficult to write.

 Parsing a sequence of null-terminated strings is trivial in C.
Unquoting, and following the demented shell quoting rules to the
letter, not so much. There are other programs than the shell out
there, and I like to be able to write my own utilities in C without
having to link against a gigantic shell library.

 The guys who invented -print0 did it for the sake of simplicity, which
is almost always a wise choice. If this choice makes a busybox function
harder to write, it's probably because the function has not been well
designed in the first place, or is being ill-used; a null delimitor
should make C coding *easier*.

 The right thing is to write line parsing functions that use only
*one* delimitor (be it \n, \0 or anything else), and to keep the
two-delimitor function somewhere for applets that need it (typically
syslogd).

 I have, and would provide, line reading functions, which perform
automatic as-needed reallocation and everything else you need in a
simple and (I think) optimal way, but they use stralloc and other
data structures that you guys probably don't want to add to Busybox.
(But then again, runit utilities have been added to Busybox, so maybe
restructuring the internal MM and I/O then linking it against skalibs
would make sense at some point.)

-- 
 Laurent
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to