From cca66ab341ffa330908aa6ea8da03e991aa6903c Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 11 Oct 2005 16:48:05 +0000 Subject: 21862/21863: GLOB_SUBST shouldn't swallow up backslashes in parameter substitutions that don't match anything. --- Test/D04parameter.ztst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Test/D04parameter.ztst') diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst index 3ad19368d..6abba0ab3 100644 --- a/Test/D04parameter.ztst +++ b/Test/D04parameter.ztst @@ -196,6 +196,20 @@ >* boringfile evenmoreboringfile boringfile evenmoreboringfile >boringfile evenmoreboringfile +# The following tests a bug where globsubst didn't preserve +# backslashes when printing out the original string. + str1='\\*\\' + ( + setopt globsubst nonomatch + [[ \\\\ = $str1 ]] && print -r '\\ matched by' $str1 + [[ \\foo\\ = $str1 ]] && print -r '\\foo matched by' $str1 + [[ a\\b\\ = $str1 ]] || print -r 'a\\b not matched by' $str1 + ) +0:globsubst with backslashes +>\\ matched by \\*\\ +>\\foo matched by \\*\\ +>a\\b not matched by \\*\\ + print -l "${$(print one word)}" "${=$(print two words)}" 0:splitting of $(...) inside ${...} >one word -- cgit 1.4.1