DragonFly BSD
DragonFly commits List (threaded) for 2005-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cvs commit: src/lib/libc/stdlib Makefile.inc getopt_long.3 getopt_long.c


From: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Mon, 14 Mar 2005 13:50:55 +0100
Mail-followup-to: commits@crater.dragonflybsd.org

On Mon, Mar 14, 2005 at 01:09:36PM +0900, YONETANI Tomokazu wrote:
> This is what I've found so far:
> - traditional getopt() accepts a single hyphen alone as an option,
>   whereas getopt_internal() doesn't. su(8) expects this behavior.
> - traditional getopt() does not parse beyond non-option arguments,
>   but getopt_internal() does. find(1) expects getopt() to stop
>   looking for options when it encountered the list of pathname.
> 
> While being able to place options after non-option arguments are useful,
> doing so requires rewrite of commands using getopt().

You are right here. The fix for find is to specify '+' to prevent this
behaviour. For su, it depended on an undocumented feature of getopt(3)
and should be fixed now. I'll go through the other users of getopt(3)
today, but I don't expect major trouble for anything outside, since this
is the default behaviour of GNU's getopt.

Joerg



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