diff --git a/ChangeLog b/ChangeLog index 772a7771..69049521 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2007-09-27 Eric Blake + 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 73ee6e9c..73dc8f75 100644 --- 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. diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4 index 7004754c..c03995b7 100644 --- a/lib/m4sugar/m4sh.m4 +++ b/lib/m4sugar/m4sh.m4 @@ -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 diff --git a/lib/m4sugar/m4sugar.m4 b/lib/m4sugar/m4sugar.m4 index 72c896c3..cd05ab4a 100644 --- a/lib/m4sugar/m4sugar.m4 +++ b/lib/m4sugar/m4sugar.m4 @@ -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], diff --git a/tests/m4sh.at b/tests/m4sh.at index 41885cd8..a523785b 100644 --- a/tests/m4sh.at +++ b/tests/m4sh.at @@ -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