[Top][All Lists]

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

Re: cvs -- sanity.sh invalid option nit

From: Mark D. Baushke
Subject: Re: cvs -- sanity.sh invalid option nit
Date: Thu, 28 Apr 2011 16:51:14 -0700

Hi David,

[Regarding RHEL 4, it uses glibc 2.3.4 which is indeed a lot older than
version 2.9 or the latest 2.13.]

Regarding POSIX 1003.2 compliance. Please consider the URLs:


The POSIX 1003.2 correct response is

 "%s: illegal option -- %c\n", <program name>, <option character>

WITHOUT the quotes around the character.

The CVS lib/getopt.c file will use 'illegal' when POSIXLY_CORRECT is set
in the environment and 'invald' when it is not.

It is clear that the glibc-2.13/posix/getopt.c line 804 and 807 are
buggy because they do indeed use:

  "%s: invalid option -- '%c'\n", argv[0], c

which is also clearly NOT following the POSIX 1003.2 standard. As long
as you are reporting bugs, reporting that one might be desirable.

I have patched the src/sanity.sh and included a copy of the patch after
my .signature. Let me know of any problems with it.

> For files outside of the CVS directories, does cvs ever use stdio? 

Yes. The client/server mechanism uses stdio stuff. See src/buffer.c for
how it is used between the client/server and server/child processes.

> The testsuite failures I'm seeing are making it hard for me to tell
> whether I've fixed the bug I'm chasing.

Ahhh... okay.

        Good luck,
        -- Mark

PS: This is the patch I committed to the main trunk of CVS.

--- ChangeLog   28 Apr 2011 00:30:43 -0700      1.3647
+++ ChangeLog   28 Apr 2011 16:47:13 -0700      
@@ -1,3 +1,10 @@
+2011-04-28  Mark D. Baushke  <address@hidden>
+       * sanity.sh (basicb-21): The getopt() in glibc 2.9 thru 2.13 are
+       not posix.2 compliant. They use "%s: invalid option -- '%c'\n"
+       instead of "%s: illegal option -- %c\n", so adjust the expr.
+       (Reported by David Taylor <address@hidden>.)
 2011-03-30  Larry Jones  <address@hidden>
        * gpg.c (parse_signature_subpacket): Correct spout->raw memory
--- ccvs/src/sanity.sh  28 Apr 2011 00:30:46 -0700      1.1219
+++ ccvs/src/sanity.sh  28 Apr 2011 15:43:37 -0700      
@@ -3980,9 +3980,9 @@ ${SPROG} \[admin aborted\]: attempt to d
          # lib/getopt.c will use POSIX when __posixly_correct
          # otherwise the other, so accept both of them. -- mdb
          dotest_fail basicb-21 "${testcvs} -q admin -H" \
-"admin: invalid option -- H
+"admin: invalid option -- ${DOTSTAR}H${DOTSTAR}
 ${CPROG} \[admin aborted\]: specify ${CPROG} -H admin for usage information" \
-"admin: illegal option -- H
+"admin: illegal option -- ${DOTSTAR}H${DOTSTAR}
 ${CPROG} \[admin aborted\]: specify ${CPROG} -H admin for usage information"
          cd ..
          rmdir 1

reply via email to

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