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

2005-05-11 Thread Karl Berry
GNU getopt tries to do too much when it reorders the commandline and therefor needs the "+" as a workaround. I don't suppose it matters at this point, but I fail to see the connection here. You can tell GNU getopt to REQUIRE_ORDER instead of PERMUTE without using +, either directly or set

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

2005-05-10 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Karl Berry wrote: > GNU getopt tries to do too much when it reorders the commandline and > therefor needs the "+" as a workaround. > >I don't suppose it matters at this point, but I fail to see the >connection here. You can tell GNU getopt to REQUIRE_

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

2005-05-10 Thread Derek Price
Paul Eggert wrote: >Derek Price <[EMAIL PROTECTED]> writes: > > > >>Revised patch attached. >> >> > >Thanks; I installed the following slightly-different patch. > > Works for me. Thanks Paul. Derek ___ Bug-cvs mailing list Bug-cvs@gnu.org

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

2005-05-10 Thread Paul Eggert
Derek Price <[EMAIL PROTECTED]> writes: > Revised patch attached. Thanks; I installed the following slightly-different patch. 2005-05-10 Derek Price <[EMAIL PROTECTED]> * getopt.m4 (gl_GETOPT): Check for Solaris 10 bug, not decl, when possible. --- getopt.m4 6 May 2005 01:0

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

2005-05-10 Thread Larry Jones
Derek Price writes: > > Okay, looking at that in C89 now, but just out of curiosity, if argv > needs to be NULL terminated, what's the point of argc? I believe it was added for convenience back in the dark ages. All the Unix exec functions require a null-terminated argument list (and don't have

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

2005-05-10 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matthias Kurz wrote: >I'm running out of time. I have to quit. Thanks very much for your effords. >When there is something to test, i'll still try to help. No problem. Thanks for your help, Matthias. Regards, Derek -BEGIN PGP SIGNATURE- V

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

2005-05-10 Thread Derek Price
Paul Eggert wrote: >Derek Price <[EMAIL PROTECTED]> writes: > > > > >>+ myargv[[0]] = "conftest"; >>+ myargv[[1]] = "-+"; >> >> > >This doesn't null-terminate myargv. > > Okay, looking at that in C89 now, but just out of curiosity, if argv needs to be NULL terminated, what

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

2005-05-10 Thread Derek Price
Paul Eggert wrote: >Derek Price <[EMAIL PROTECTED]> writes: > > > > >>+ myargv[[0]] = "conftest"; >>+ myargv[[1]] = "-+"; >> >> > >This doesn't null-terminate myargv. > >But I still don't get why the change is needed. It sounds like you're >assuming Solaris 11 getopt might g

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

2005-05-10 Thread Matthias Kurz
On Tue, May 10, 2005, Matthias Kurz wrote: > On Mon, May 09, 2005, Paul Eggert wrote: > [...] > > But I still don't get why the change is needed. It sounds like you're > > assuming Solaris 11 getopt might get fixed? But even in that case, > > the current code will work, right, since it will use

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

2005-05-09 Thread Matthias Kurz
On Mon, May 09, 2005, Paul Eggert wrote: > Derek Price <[EMAIL PROTECTED]> writes: > > > > + myargv[[0]] = "conftest"; > > + myargv[[1]] = "-+"; > > This doesn't null-terminate myargv. D'oh ! > But I still don't get why the change is needed. It sounds like you're > assuming S

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

2005-05-09 Thread Paul Eggert
Derek Price <[EMAIL PROTECTED]> writes: > + myargv[[0]] = "conftest"; > + myargv[[1]] = "-+"; This doesn't null-terminate myargv. But I still don't get why the change is needed. It sounds like you're assuming Solaris 11 getopt might get fixed? But even in that case, the curren

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

2005-05-09 Thread Derek Price
Derek Price wrote: >>>2005-05-05 Paul Eggert <[EMAIL PROTECTED]> >>> >>> * lib/getopt.m4 (gl_GETOPT): Check for Solaris 10 getopt, and >>> avoid needless checks. >>> >>> >>Yes, this also works for me. >> >> > >Okay, one more revision, to actually check if the -+ registers as

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

2005-05-09 Thread Derek Price
-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 v

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

2005-05-09 Thread Derek Price
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

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

2005-05-09 Thread Matthias Kurz
On Mon, May 09, 2005, Derek Price wrote: [...] > I did read this correctly in your report. If anyone else sees a need > for an actual test for correct optind=0 behavior, then they are welcome > to write one, but I decided the point was moot at the moment since > detecting the "+" bug, just as val

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

2005-05-09 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matthias Kurz wrote: >Hi. > >One more clarification. Maybe one or the other missed my last comments >on . It was me, >who introduced the "'+' myth". Well, it is not a myth. I studied the test pro

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

2005-05-09 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matthias Kurz wrote: >I do not think that this is a Solaris _bug_. - From the point of view of the GNULIB getopt.m4 tests, if it doesn't behave like GNU getopt, that is a bug. :) >I'd bet that every system that does not use GNU getopt will suffer

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

2005-05-09 Thread Matthias Kurz
Hi. One more clarification. Maybe one or the other missed my last comments on . It was me, who introduced the "'+' myth". I "analysed" the problem wrong in the beginning. It is not exactly the "+" that makes the problem, but the fact, that the

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

2005-05-09 Thread Matthias Kurz
On Mon, May 09, 2005, Derek Price wrote: [...] > Okay, one more revision, to actually check if the -+ registers as an > option or not. This fits the autoconf paradigm of testing for the bug, > even if it is using AC_TRY_RUN. This way, if Sun fixes the problem in a > later Solaris release, we sho

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

2005-05-09 Thread Derek Price
Matthias Kurz wrote: >On Thu, May 05, 2005, Paul Eggert wrote: > > > >>Derek Price <[EMAIL PROTECTED]> writes: >> >> >> >>>I prefer door #2. Trivial patch attached: >>> >>> >>Thanks, but I'd rather use AC_CHECK_DECL, so I installed this instead, >>into both coreutils and gnulib. Does

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

2005-05-06 Thread Matthias Kurz
On Thu, May 05, 2005, Paul Eggert wrote: > Derek Price <[EMAIL PROTECTED]> writes: > > > I prefer door #2. Trivial patch attached: > > Thanks, but I'd rather use AC_CHECK_DECL, so I installed this instead, > into both coreutils and gnulib. Does it work? > > 2005-05-05 Paul Eggert <[EMAIL PR

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

2005-05-06 Thread Paul Eggert
Derek Price <[EMAIL PROTECTED]> writes: > I prefer door #2. Trivial patch attached: Thanks, but I'd rather use AC_CHECK_DECL, so I installed this instead, into both coreutils and gnulib. Does it work? 2005-05-05 Paul Eggert <[EMAIL PROTECTED]> * lib/getopt.m4 (gl_GETOPT): Check for

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

2005-05-05 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Derek Price wrote: >2005-05-05 Derek Price <[EMAIL PROTECTED]> > > * m4/getopt.m4 (gl_GETOPT): Use GNULIB getopt on Solaris 10. Matthias reports that this patch does The Right Thing (tm) on Solaris 10: