DragonFly bugs List (threaded) for 2009-01
DragonFly BSD
DragonFly bugs List (threaded) for 2009-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: patch to add getopt parsing to expr


From: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Tue, 20 Jan 2009 14:02:28 +0100
Mail-followup-to: bugs@crater.dragonflybsd.org

On Mon, Jan 19, 2009 at 11:30:55PM -0500, Joe Talbott wrote:
> +	while ((ch = getopt(argc, argv, "-")) != -1) {

The use of getopt here is wrong. Besides, using getopt is taking a
sledgehammer to crack a nut. Attached is the corresponding fix for
NetBSD, the explicit check for having at least one argument is better
anyway.

Joerg



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]