getopt-gnu: Fix exit code overflow in autoconf test.
authorBruno Haible <bruno@clisp.org>
Tue, 19 Jun 2012 10:11:04 +0000 (12:11 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 19 Jun 2012 10:11:04 +0000 (12:11 +0200)
* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Squash exit code values,
to keep them below < 128.

ChangeLog
m4/getopt.m4

index b3635c6..0253664 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-19  Bruno Haible  <bruno@clisp.org>
+
+       getopt-gnu: Fix exit code overflow in autoconf test.
+       * m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Squash exit code values,
+       to keep them below < 128.
+
 2012-06-17  Jim Meyering  <meyering@redhat.com>
 
        maint.mk: fix typo in code to derive GPG key at release time
index 2aea895..0b95cdd 100644 (file)
@@ -1,4 +1,4 @@
-# getopt.m4 serial 39
+# getopt.m4 serial 40
 dnl Copyright (C) 2002-2006, 2008-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -276,7 +276,7 @@ dnl is ambiguous with environment values that contain newlines.
                if (getopt (3, argv, "-p") != 1)
                  result |= 16;
                else if (getopt (3, argv, "-p") != 'p')
-                 result |= 32;
+                 result |= 16;
              }
              /* This code fails on glibc 2.11.  */
              {
@@ -286,9 +286,9 @@ dnl is ambiguous with environment values that contain newlines.
                char *argv[] = { program, b, a, NULL };
                optind = opterr = 0;
                if (getopt (3, argv, "+:a:b") != 'b')
-                 result |= 64;
+                 result |= 32;
                else if (getopt (3, argv, "+:a:b") != ':')
-                 result |= 64;
+                 result |= 32;
              }
              /* This code dumps core on glibc 2.14.  */
              {
@@ -298,7 +298,7 @@ dnl is ambiguous with environment values that contain newlines.
                char *argv[] = { program, w, dummy, NULL };
                optind = opterr = 1;
                if (getopt (3, argv, "W;") != 'W')
-                 result |= 128;
+                 result |= 64;
              }
              return result;
            ]])],