From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6511 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH v2] getopt: fix optional argument processing Date: Sat, 15 Nov 2014 23:46:34 -0500 Message-ID: <20141116044634.GR22465@brightrain.aerifal.cx> References: <1413923090-71355-1-git-send-email-nbd@openwrt.org> 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 1416113217 6791 80.91.229.3 (16 Nov 2014 04:46:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Nov 2014 04:46:57 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6524-gllmg-musl=m.gmane.org@lists.openwall.com Sun Nov 16 05:46:50 2014 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Xprjc-0005eH-SA for gllmg-musl@m.gmane.org; Sun, 16 Nov 2014 05:46:48 +0100 Original-Received: (qmail 22128 invoked by uid 550); 16 Nov 2014 04:46:47 -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 22120 invoked from network); 16 Nov 2014 04:46:46 -0000 Content-Disposition: inline In-Reply-To: <1413923090-71355-1-git-send-email-nbd@openwrt.org> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:6511 Archived-At: On Tue, Oct 21, 2014 at 10:24:50PM +0200, Felix Fietkau wrote: > Processing an option character with optional argument fails if the > option is last on the command line. This happens because the > if (optind >= argc) check runs first before testing for optional > argument. > --- Thanks, committed. Rich