]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Fix underquotation in AS_HELP_STRING.
authorEric Blake <ebb9@byu.net>
Fri, 28 Sep 2007 01:16:51 +0000 (19:16 -0600)
committerEric Blake <ebb9@byu.net>
Fri, 28 Sep 2007 01:29:49 +0000 (19:29 -0600)
* lib/m4sugar/m4sh.m4 (AS_HELP_STRING): Don't underquote lhs
argument.
* lib/m4sugar/m4sugar.m4 (m4_text_wrap): Don't underquote
first-prefix argument.
* tests/m4sh.at (AS@&t@_HELP_STRING): Test this fix.
* NEWS: Document AS_HELP_STRING fix.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
NEWS
lib/m4sugar/m4sh.m4
lib/m4sugar/m4sugar.m4
tests/m4sh.at

index 772a77715b1859a0bb4df2871c4ef0485ed4eab5..69049521ace7f5e28cc80a4d6b4a7ce7356e683b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2007-09-27  Eric Blake  <ebb9@byu.net>
 
+       Fix underquotation in AS_HELP_STRING.
+       * lib/m4sugar/m4sh.m4 (AS_HELP_STRING): Don't underquote lhs
+       argument.
+       * lib/m4sugar/m4sugar.m4 (m4_text_wrap): Don't underquote
+       first-prefix argument.
+       * tests/m4sh.at (AS@&t@_HELP_STRING): Test this fix.
+       * NEWS: Document AS_HELP_STRING fix.
+
        Autotest formatting touchups.
        * lib/autotest/general.m4 (HELP_TUNING): Avoid TAB in terminal
        output.
diff --git a/NEWS b/NEWS
index 73ee6e9cd8483e183af56277c05cc5f65a13c09b..73dc8f75a6c980c6393f35d4add477cbd6928fd0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -38,6 +38,8 @@ GNU Autoconf NEWS - User visible changes.
 
 ** AC_USE_SYSTEM_EXTENSIONS now defines _ALL_SOURCE for Interix platforms.
 
+** AS_HELP_STRING no longer underquotes its first argument.
+
 ** The command 'autoconf -' now correctly processes a file from stdin.
 
 ** Autotest now determines $srcdir correctly.
index 7004754c71bc7b8b3860d080a786f1f3546f6831..c03995b785231b83929c809051634750115a568d 100644 (file)
@@ -1205,7 +1205,7 @@ m4_define([AS_HELP_STRING],
 [m4_pushdef([AS_Prefix], m4_default([$3], [                          ]))dnl
 m4_pushdef([AS_Prefix_Format],
           [  %-]m4_eval(m4_len(AS_Prefix) - 3)[s ])dnl [  %-23s ]
-m4_text_wrap([$2], AS_Prefix, m4_format(AS_Prefix_Format, [$1]))dnl
+m4_text_wrap([$2], AS_Prefix, m4_format(AS_Prefix_Format, [[$1]]))dnl
 m4_popdef([AS_Prefix_Format])dnl
 m4_popdef([AS_Prefix])dnl
 ])# AS_HELP_STRING
index 72c896c31ac46d34abb2604aa6516f4e0857bd5d..cd05ab4a3290bcaa2c30979fad66ffe22ab4eefa 100644 (file)
@@ -1576,16 +1576,16 @@ m4_define([m4_text_wrap],
 [m4_pushdef([m4_Prefix], [$2])dnl
 m4_pushdef([m4_Prefix1], m4_default([$3], [m4_Prefix]))dnl
 m4_pushdef([m4_Width], m4_default([$4], 79))dnl
-m4_pushdef([m4_Cursor], m4_qlen(m4_Prefix1))dnl
+m4_pushdef([m4_Cursor], m4_qlen(m4_defn([m4_Prefix1])))dnl
 m4_pushdef([m4_Separator], [])dnl
-m4_Prefix1[]dnl
-m4_if(m4_eval(m4_qlen(m4_Prefix1) > m4_len(m4_Prefix)),
+m4_defn([m4_Prefix1])[]dnl
+m4_if(m4_eval(m4_qlen(m4_defn([m4_Prefix1])) > m4_len(m4_Prefix)),
       1, [m4_define([m4_Cursor], m4_len(m4_Prefix))
 m4_Prefix],
-      m4_if(m4_eval(m4_qlen(m4_Prefix1) < m4_len(m4_Prefix)),
+      m4_if(m4_eval(m4_qlen(m4_defn([m4_Prefix1])) < m4_len(m4_Prefix)),
            [0], [],
            [m4_define([m4_Cursor], m4_len(m4_Prefix))[]dnl
-m4_for(m4_Space, m4_qlen(m4_Prefix1), m4_eval(m4_len(m4_Prefix) - 1),
+m4_for(m4_Space, m4_qlen(m4_defn([m4_Prefix1])), m4_eval(m4_len(m4_Prefix) - 1),
                    [], [ ])])[]dnl
 )[]dnl
 m4_foreach_w([m4_Word], [$1],
index 41885cd8989df8dacf43ff660e6d5ba4e38d684d..a523785b18f17e7dc64fef229a8a3a6ebde16d39 100644 (file)
@@ -2,7 +2,7 @@
 
 AT_BANNER([M4sh.])
 
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
 # Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
@@ -533,6 +533,18 @@ echo "AS_HELP_STRING([--foo@<][:@=bar@:][>@123456789012],
 [some other @<][:@ex@:][>@ which should wrap at our default of 80 characters.])"
 echo "AS_HELP_STRING([--foo@<][:@=bar@:][>@1234567890123],
 [some other @<][:@ex@:][>@ which should wrap at our default of 80 characters.])"
+echo "AS_HELP_STRING([[--foo[=bar]]],
+[some other t[]t which should wrap at our default of 80 characters.])"
+echo "AS_HELP_STRING([[--foo[=bar]123456789]],
+[some other t[]t which should wrap at our default of 80 characters.])"
+echo "AS_HELP_STRING([[--foo[=bar]1234567890]],
+[some other t[]t which should wrap at our default of 80 characters.])"
+echo "AS_HELP_STRING([[--foo[=bar]12345678901]],
+[some other t[]t which should wrap at our default of 80 characters.])"
+echo "AS_HELP_STRING([[--foo[=bar]123456789012]],
+[some other t[]t which should wrap at our default of 80 characters.])"
+echo "AS_HELP_STRING([[--foo[=bar]1234567890123]],
+[some other t[]t which should wrap at our default of 80 characters.])"
 ]])
 
 AT_CHECK_M4SH
@@ -575,6 +587,19 @@ AT_CHECK([./script], [0],
   --foo[=bar]1234567890123
                           some other [ex] which should wrap at our default of
                           80 characters.
+  --foo[=bar]             some other t[]t which should wrap at our default of
+                          80 characters.
+  --foo[=bar]123456789    some other t[]t which should wrap at our default of
+                          80 characters.
+  --foo[=bar]1234567890   some other t[]t which should wrap at our default of
+                          80 characters.
+  --foo[=bar]12345678901  some other t[]t which should wrap at our default of
+                          80 characters.
+  --foo[=bar]123456789012 some other t[]t which should wrap at our default of
+                          80 characters.
+  --foo[=bar]1234567890123
+                          some other t[]t which should wrap at our default of
+                          80 characters.
 ]])
 
 AT_CLEANUP