diff --git a/ChangeLog b/ChangeLog index 34ad5c09..4c158f5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-05-05 Noah Misch + + * lib/autotest/general.m4 (_AT_NORMALIZE_TEST_GROUP_NUMBER): Use `eval'. + * doc/autoconf.texi ($@, case): Document Zsh limitations. + 2007-05-03 Stepan Kasal * lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_DEFAULT): Put a.out first. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 05c3b29a..28c93ca2 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -11600,6 +11600,10 @@ One workaround relies on Zsh's ``global aliases'' to convert test "$@{ZSH_VERSION+set@}" = set && alias -g '$@{1+"$@@"@}'='"$@@"' @end example +Zsh only recognizes this alias when a shell word matches it exactly; +@samp{"foo"$@{1+"$@@"@}} remains subject to word splitting. Since this +case always yields at least one shell word, use plain @samp{"$@@"}. + A more conservative workaround is to avoid @samp{"$@@"} if it is possible that there may be no positional arguments. For example, instead of: @@ -12358,6 +12362,16 @@ esac but the @code{(} in this example is not portable to many Bourne shell implementations. It can be omitted safely. +Zsh handles pattern fragments derived from parameter expansions or +command substitutions as though quoted: + +@example +$ pat=\?; case aa in ?$pat) echo match;; esac +$ pat=\?; case a? in ?$pat) echo match;; esac +match +@end example + +@noindent Because of a bug in its @code{fnmatch}, Bash fails to properly handle backslashes in character classes: diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index 95fd7694..04a1f952 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -154,12 +154,12 @@ m4_define([AT_LINE], # all the other test group numbers. m4_define([_AT_NORMALIZE_TEST_GROUP_NUMBER], [ - while :; do + eval 'while :; do case $$1 in #( - $at_format*) break;; + '"$at_format"'*) break;; esac $1=0$$1 - done + done' ]) # _AT_CREATE_DEBUGGING_SCRIPT