[BusyBox] bug#1065: New xargs implementation

Mark Whitley markw at lineo.com
Fri Nov 10 23:06:52 UTC 2000


Fellow Busyboxers,

I was looking at bug #1065 and made a stab at fixing it. I actually worked
from the existing code but what I ended up with looks almost like a brand-new
implementation. Before I recklessly committed this to CVS, I thought I'd
submit it for public approval (and by "public" I mostly mean "Erik's"). File
is attached.

Some notes: This version works for the test case provided in bug 1065, so it
would close that bug. Also, I have removed support for the -t flag. I don't
think it's removal is going to hurt anyone because A) most programs you use
with xargs display the filename and B) implementing support for -t really
bloats up the memory/CPU usage 'cuz you have to:

 - read in the list of files from stdin 
 - tack them all onto a big list, malloc-ing as you go
 - then you have to display the contents of the list
 - then go back through the list and actually execute the command on the list
 - ick

So I threw out support for -t. So sue me.

Anywho, give it a look see, if anyone finds any horrible bugs, lemme know.

Cheers,

Mark Whitley
markw at lineo.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xargs.c
Type: text/x-csrc
Size: 2793 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20001110/8d7cffb6/attachment.c 


More information about the busybox mailing list