mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-27 06:11:06 +02:00
27780: effect of backslashes in :s changed in _files
This commit is contained in:
parent
43df0a21c0
commit
ec3f3e9eec
3 changed files with 27 additions and 2 deletions
|
@ -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 $
|
||||
*****************************************************
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,}
|
||||
|
|
Loading…
Reference in a new issue