|
Message-ID: <CAPLrYETtdr+O5odZcnRzbnjiLkMpRMdV-tGsQT7ZwZ9d_OcD7w@mail.gmail.com>
Date: Sun, 30 Sep 2012 23:32:44 +0200
From: Daniel Cegiełka <daniel.cegielka@...il.com>
To: musl@...ts.openwall.com
Subject: Re: better compatibility with bsd getopt()
2012/9/30 Rich Felker <dalias@...ifal.cx>:
>> 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;
>
> Except the BSD way is the braindamaged one because it violates the
> namespace. The GNU way simply defines something that was previously
> undefined by the standard without affecting the namespace.
>
> If needed, I think it's possible to support both, with some weak
> symbol hacks...
sample solution for gnu/bsd getopt() - of course this patch needs this
weak symbol hacks...
Daniel
Download attachment "musl_gnu_bsd_getopt_reset.diff" of type "application/octet-stream" (1041 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.