On Wednesday 17 June 2009 17:48:11 Tito wrote:
> Hi Rob,
> seems to me that this code confuses the arg parsing
>
>       /* We must avoid interpreting -NUM (signal num) as an option */
>       first_arg_idx = 1;
>       while (1) {
>               first_arg = argv[first_arg_idx];
>               if (!first_arg)
>                       break;
>               /* not "-<small_letter>..."? */
>               if (first_arg[0] != '-' || first_arg[1] < 'a' || first_arg[1] > 
> 'z') {
>                       argv[first_arg_idx] = NULL; /* terminate argv here */
>                       break;
>               }
>               first_arg_idx++;
>       }

Ah yes, that'd do it. :)

> Please try if this snippet does the trick for you, it is just a proof of
> concept and only little tested.

I can take it from here.  I have a mostly finished patch queued up, just 
needing the option parsing.  (Currently pondering whether to add a -G genocide 
option to recursively kill a process, all its child processes, all _their_ 
child processes, and so on.  I keep needing one and there's no obvious way to 
do that...)

Nice cleanup though, I'll see what I can incorporate.

Thanks,

Rob
-- 
Latency is more important than throughput. It's that simple. - Linus Torvalds
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to