[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: hush: initial trap support
From: Mike Frysinger <vapier () gentoo ! org>
Date: 2009-03-29 23:38:38
Message-ID: 200903291938.39531.vapier () gentoo ! org
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
On Sunday 29 March 2009 17:57:32 Denys Vlasenko wrote:
> + sig = bb_strtou(argv[i], NULL, 10);
> + if (errno)
> + sig = get_signum(argv[i]);
>
> get_signum() already does this check for "numericity".
indeed
> + if (strcmp(argv[1], "-") == 0)
> + /* nothing! */;
> + else
> + new_cmd = argv[1];
> + if (strcmp(argv[1], "") == 0)
>
> Smaller code would be:
>
> + if (LONE_CHAR(argv[1], '-'))
> + /* nothing! */;
> + else
> + new_cmd = argv[1];
> + if (argv[1][0] == '\0')
there's a LONE_DASH() that can be used ... but why bother ? gcc is smart
enough to convert strcmp()'s of 0 and 1 byte long strings and avoid the
function call ...
> Otherwise looks ok, please apply, unless you want to go all the way
> and implement "delayed handling" correctly.
i'll commit it as is now since this is known to work (mostly). not sure if
i'll look into the next part ...
-mike
["signature.asc" (application/pgp-signature)]
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic