From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2033 Path: news.gmane.org!not-for-mail From: =?ISO-8859-2?Q?Daniel_Cegie=B3ka?= Newsgroups: gmane.linux.lib.musl.general Subject: Re: better compatibility with bsd getopt() Date: Sun, 30 Sep 2012 23:18:33 +0200 Message-ID: References: <5068B362.5070408@barfooze.de> <20120930210013.GO254@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1349039946 23553 80.91.229.3 (30 Sep 2012 21:19:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Sep 2012 21:19:06 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2034-gllmg-musl=m.gmane.org@lists.openwall.com Sun Sep 30 23:19:12 2012 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 1TIQus-0004p3-KY for gllmg-musl@plane.gmane.org; Sun, 30 Sep 2012 23:19:10 +0200 Original-Received: (qmail 15569 invoked by uid 550); 30 Sep 2012 21:19:05 -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 15561 invoked from network); 30 Sep 2012 21:19:05 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=zEGbEbs79Ny6NASwBaBX3+UT6J6lesnQPxVwESoVAn4=; b=RvHaHISrJWzvxt4gu3vh6KKgBB4HawwxocGga97qFnaz7ZSY/1NYImPt0XSUDCcQ+o 2glrkqTBT5JKdL1Aay9i4qBblJF1fV8lN6mX0q5MXOZK4pqIA8zUN3GEaseIrvqr32fw NMYNkYtC3q51/+9G9A6Hs0b8VlTZZJasUqdr4/4ATrIbDyukI7uHZG00cWuizpKms/ot 3vK2TAaK92dNEeeIK7Yam8+xfv7DmRA4niHsQha0+Iiqdx5QQYzQlCOWQPBthRs+kyqY Zpp1wbVbdhvbOcfgLfJIDoxWbIk8IGcDUBPBN6zwLOCqVdc5MHE/uTFX/gPweW2FVob1 LzMA== In-Reply-To: <20120930210013.GO254@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:2033 Archived-At: > > If the only need is option resetting, I think we can handle that > without any cost, and avoid linking in duplicate code to meet > applications' needs. > > Rich OpenBSD solves gnu reset option in this way: /* * XXX Some GNU programs (like cvs) set optind to 0 instead of * XXX using optreset. Work around this braindamage. */ if (optind == 0) optind = optreset = 1; http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdlib/getopt_long.c?rev=1.25;content-type=text%2Fplain So using the gnu reset (optind == 0) and BSD optreset should not be so difficult. Daniel