bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnulib] Re: getopt and Solaris 10


From: Derek Price
Subject: Re: [bug-gnulib] Re: getopt and Solaris 10
Date: Mon, 09 May 2005 13:30:53 -0400
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

...I know you already agreed...  ...I just thought this was interesting...

In fact, Solaris 10 is the one actually sticking to the letter of the
POSIX spec here, not that I think that assuming argv[0] should not be
processed is going to hurt the GNU version:

    The variable /optind/ is the index of the next element of the
/argv/[] vector to be processed. It is initialised to 1 by the system,

    ...

    If, when /getopt()/ is called:

|
 /    argv/[optind]    is a null pointer
    */argv/[optind]    is not the character -
     /argv/[optind]    points to the string "-"
|

     /getopt/() returns -1 without changing /optind./


Cheers,

Derek


Derek Price wrote:

>Regardless, since using an optind = 0 is not specified as supported by
>POSIX, whereas optind = 1 is, and since using optind = 1 in place of
>optind = 0 in CVS would avoid this problem on all platforms and with all
>versions of getopt (supporting optind = 0 provides no additional
>functionality that I know of), I don't think this is properly considered
>a Solaris bug, but a CVS bug.
>
>At least, it would be a CVS bug if we didn't have to use the GNU getopt
>on Solaris due to the "+" problem anyhow.
>
>Cheers,
>
>Derek
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCf55NLD1OTBfyMaQRApD/AKDG91RXkmD1GjNyqLJmzFjQq9vCBwCfbjTw
HHeRY0WAPlT67fsFFn0PNuE=
=oFUI
-----END PGP SIGNATURE-----






reply via email to

[Prev in Thread] Current Thread [Next in Thread]