[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getopt usage
From: |
Eric Blake |
Subject: |
Re: getopt usage |
Date: |
Fri, 27 Nov 2009 21:52:47 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Eric Blake on 8/13/2009 7:32 AM:
> Gnulib recently separated POSIX getopt from GNU getopt extensions, and
> marked the getopt module obsolete. This fixes m4 to work with the latest
> gnulib.git again.
And in the process, caused a regression on BSD which doesn't properly
honor the GNU extension of leading '-' in the optstring argument when
POSIXLY_CORRECT is set.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAksQrJ8ACgkQ84KuGfSFAYDWAQCfQj0nwUdGpQR68NYeICedIdFa
K2IAnjeXPLnQw7OIfh9qxzMa58jnF8KJ
=8wsp
-----END PGP SIGNATURE-----
>From a6c565c6f4b934be334dd9ada97b215595d10103 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Fri, 27 Nov 2009 21:45:33 -0700
Subject: [PATCH] Work around BSD getopt bug.
* gnulib: Update.
* doc/m4.texinfo (Command line files): Add test.
Signed-off-by: Eric Blake <address@hidden>
---
ChangeLog | 4 ++++
doc/m4.texinfo | 16 ++++++++++++++++
gnulib | 2 +-
3 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 80f0d6c..0c9b193 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2009-11-28 Eric Blake <address@hidden>
+ Work around BSD getopt bug.
+ * gnulib: Update.
+ * doc/m4.texinfo (Command line files): Add test.
+
Use fastmap for better regex performance.
* src/input.c (word_start): Delete.
(pop_wrapup): Free memory on exit.
diff --git a/doc/m4.texinfo b/doc/m4.texinfo
index 2cf86d4..550fa4a 100644
--- a/doc/m4.texinfo
+++ b/doc/m4.texinfo
@@ -989,6 +989,22 @@ Command line files
@error{}bye
@result{}0
@end example
+
address@hidden Test that we obey POSIX semantics with -D interspersed with
address@hidden files, even with POSIXLY_CORRECT (BSD getopt gets it wrong).
+
+$ @kbd{m4 }
address@hidden
+ifdef(`__unix__', ,
+ `errprint(` skipping: syscmd does not have unix semantics
+')m4exit(`77')')dnl
+changequote(`[', `]')dnl
+syscmd([POSIXLY_CORRECT=1 ']__program__[' -Dbar=hello foo -Dbar=world foo])dnl
address@hidden
address@hidden
+sysval
address@hidden
address@hidden example
@end ignore
@node Syntax
diff --git a/gnulib b/gnulib
index 23cd741..c0c5acf 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 23cd74133c81b80d335c701848b71d85a53402c6
+Subproject commit c0c5acfbe255f5542bc1c81c7aec223d95e504a6
--
1.6.5.rc1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: getopt usage,
Eric Blake <=