aboutsummaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-03-05 15:25:29 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2014-03-05 15:25:29 +0200
commit477701c059d73e47aa1bac97e96d801542f2bd8f (patch)
treecc2622344bef3b8c63fe2d3b041b10b099bd15d2 /build-aux
parent9c964ec8a4fe23fef993a1cf7f4563d0c32b68bd (diff)
downloadgrecs-477701c059d73e47aa1bac97e96d801542f2bd8f.tar.gz
grecs-477701c059d73e47aa1bac97e96d801542f2bd8f.tar.bz2
Bugfix in getopt.m4
* build-aux/getopt.m4 (__GATHER_OPTIONS): Properly quote SHORT_OPTS. In the course of construction it may happen to end in sequence "dnl", so care should be taken to quote it.
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/getopt.m48
1 files changed, 6 insertions, 2 deletions
diff --git a/build-aux/getopt.m4 b/build-aux/getopt.m4
index 4f11139..68989ab 100644
--- a/build-aux/getopt.m4
+++ b/build-aux/getopt.m4
@@ -145,6 +145,10 @@ divert(3)
{ NULL, NULL, 0, N_("prep([<$1>])") },
divert(-1)>])
+# quote(args) - convert args to single-quoted string
+define([<quote>], [<ifelse([<$#>], [<0>], [<>], [<[<$*>]>])>])
+define([<dquote>], [<[<$@>]>])
+
define([<__GATHER_OPTIONS>],[<
define([<KEY>],ifelse([<$2>],,[<OPTION_>]upcase(patsubst($1,-,_)),'$2'))
ifelse([<$2>],,[<
@@ -158,8 +162,8 @@ divert(2)
{ "$1", ARGTYPE, 0, KEY },
divert(-1)>])
dnl
-define([<SHORT_OPTS>],SHORT_OPTS[<>]dnl
-ifelse([<$2>],,,$2[<>]ifelse(ARGTYPE,[<no_argument>],,ARGTYPE,[<required_argument>],:,ARGTYPE,[<optional_argument>],::)))
+define([<SHORT_OPTS>],dquote(SHORT_OPTS[<>]dnl
+ifelse([<$2>],,,[<$2>]ifelse(ARGTYPE,[<no_argument>],,ARGTYPE,[<required_argument>],:,ARGTYPE,[<optional_argument>],::))))
dnl
ifelse([<$1>],,,dnl
[<define([<LONG_TAG>],ifelse(LONG_TAG,,[<--$1>],[<LONG_TAG; --$1>]))>])

Return to:

Send suggestions and report system problems to the System administrator.