[pass] [patch] use getopt to regularize options

Simon Zimmermann simon at insmo.com
Wed Sep 12 09:31:53 CEST 2012


On Wed, Sep 12, 2012 at 7:21 AM, Brian Mattern <rephorm at rephorm.com> wrote:
> I *think* this is portable, but don't have access to any
> systems other than linux to test on.

Linux uses GNU C getopt library, while Mac OS X the BSD C
implementation of it. To quote wikipedia:

> getopt is not a system independent function. The
> implementation of getopt in GNU C Library does permute the
> contents of the argument vector as it scans, so that
> eventually all the non-option arguments are at the end. On
> the contrary, the implementation of getopt in BSD C Library
> does not permute the argument vector and returns -1 if it
> encounters a non-option argument. [1]

I did not review your patch, but if using getopt one needs to
take this into consideration.

[1]: http://en.wikipedia.org/wiki/Getopt



More information about the Password-Store mailing list