From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5662 Path: news.gmane.org!not-for-mail From: Felix Janda Newsgroups: gmane.linux.lib.musl.general Subject: Re: More GNU semantics for getopt_long? Date: Mon, 28 Jul 2014 00:30:44 +0200 Message-ID: <20140727223044.GA10396@euler> References: <20140726091236.GA6011@euler> <20140726093140.GM4038@brightrain.aerifal.cx> <20140726174730.GA11205@euler> <20140727183546.GC4038@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1406500305 16069 80.91.229.3 (27 Jul 2014 22:31:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Jul 2014 22:31:45 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5667-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jul 28 00:31:39 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XBWye-0004Ke-5l for gllmg-musl@plane.gmane.org; Mon, 28 Jul 2014 00:31:36 +0200 Original-Received: (qmail 30243 invoked by uid 550); 27 Jul 2014 22:31:35 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 30235 invoked from network); 27 Jul 2014 22:31:35 -0000 X-Virus-Scanned: amavisd-new at posteo.de Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: <20140727183546.GC4038@brightrain.aerifal.cx> User-Agent: Mutt/1.5.22 (2013-10-16) Xref: news.gmane.org gmane.linux.lib.musl.general:5662 Archived-At: Rich Felker wrote: [..] > > > > I noticed that there is a patch from Michael Forney on the mailing > > > > list implementing the abbreviated options but there were not any > > > > comments on it. > > > > > > Yes that's it. > > > > Thanks for revisiting the patch. > > Have you tried it and confirmed that it solves your problem and > doesn't introduce any bugs that you immediately notice? I'd like to > include it in the upcoming release but I don't want to introduce a > stupid regression from lack of testing... I did some tests right now. The abbreviated options seem to work. If the long option abbreviation is ambiguous, patched musl's getopt_long will return the last match in the longopts array instead of '?'. I also noticed that 66fcde4ae4a52ae3edb1cf237ce2c22d08d7a062 seems to have broken getopt_long: Even if optstring does not begin with ':', getopt_long will return ':' if a long option is not supplied by its required argument. Felix