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

看板DFBSD_commit作者時間21年前 (2005/03/14 21:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/4 (看更多)
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
文章代碼(AID): #12DOiU00 (DFBSD_commit)
文章代碼(AID): #12DOiU00 (DFBSD_commit)