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.
** 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.
[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
[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],
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
[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
--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