diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2010-03-15 10:15:51 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2010-03-15 10:15:51 +0000 |
commit | ec3f3e9eeceaaf694e5dfbe15d07d11a304fd944 (patch) | |
tree | 1a39323f448591f3a5b563c1a4b923ec40b3db0e | |
parent | 43df0a21c0dfa9536b0c8ce816685a6002451f54 (diff) | |
download | zsh-ec3f3e9eeceaaf694e5dfbe15d07d11a304fd944.tar.gz zsh-ec3f3e9eeceaaf694e5dfbe15d07d11a304fd944.tar.xz zsh-ec3f3e9eeceaaf694e5dfbe15d07d11a304fd944.zip |
27780: effect of backslashes in :s changed in _files
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | Completion/Unix/Type/_files | 2 | ||||
-rw-r--r-- | Test/D04parameter.ztst | 19 |
3 files changed, 27 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog index 572a4e826..34171de9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-03-15 Peter Stephenson <pws@csr.com> + + * 27780: Completion/Unix/Type/_files, Test/D04parameter.ztst: + users/14905 changed the number of backslashes needed to + quote backslashes in :s modifier. + 2010-03-11 Peter Stephenson <p.w.stephenson@ntlworld.com> * unposted: Doc/Zsh/expn.yo: note that & needs quoting in :s in @@ -12890,5 +12896,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.4928 $ +* $Revision: 1.4929 $ ***************************************************** diff --git a/Completion/Unix/Type/_files b/Completion/Unix/Type/_files index 1969a5feb..762ef4eaa 100644 --- a/Completion/Unix/Type/_files +++ b/Completion/Unix/Type/_files @@ -90,7 +90,7 @@ fi tried=() for def in "$pats[@]"; do - eval "def=( ${${def:gs/\\:/\\\\\\\\\\\\:}//(#b)([][()|*?^#~<>])/\\${match[1]}} )" + eval "def=( ${${def:gs/\\:/\\\\\\:}//(#b)([][()|*?^#~<>])/\\${match[1]}} )" tmp="${(@M)def#*[^\\]:}" (( $tried[(I)${(q)tmp}] )) && continue diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst index f81b7de1d..d43e60efa 100644 --- a/Test/D04parameter.ztst +++ b/Test/D04parameter.ztst @@ -959,6 +959,25 @@ >oof/rab >oof/rab + bsbs='X\\\\Y' + print -r -- ${bsbs:s/\\/\\/} + print -r -- "${bsbs:s/\\/\\/}" + print -r -- ${bsbs:s/\\\\/\\\\/} + print -r -- "${bsbs:s/\\\\/\\\\/}" + print -r -- ${bsbs:gs/\\/\\/} + print -r -- "${bsbs:gs/\\/\\/}" + print -r -- ${bsbs:gs/\\\\/\\\\/} + print -r -- "${bsbs:gs/\\\\/\\\\/}" +0:Handling of backslashed backslashes in substitution modifier +>X\\\\Y +>X\\\\Y +>X\\\\Y +>X\\\\Y +>X\\\\Y +>X\\\\Y +>X\\\\Y +>X\\\\Y + print -r ${${:-one/two}:s,/,X&Y,} print -r ${${:-one/two}:s,/,X\&Y,} print -r ${${:-one/two}:s,/,X\\&Y,} |