summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--Completion/Unix/Type/_files2
-rw-r--r--Test/D04parameter.ztst19
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,}