changeset 53272:bb2708b976f1

(comint-quote-filename): Correctly handle backslash in comint-file-name-quote-list.
author Andreas Schwab <schwab@suse.de>
date Wed, 24 Dec 2003 10:05:31 +0000
parents 00ac28166865
children 0f1ef5c0e5d7
files lisp/comint.el
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/comint.el	Wed Dec 24 07:32:41 2003 +0000
+++ b/lisp/comint.el	Wed Dec 24 10:05:31 2003 +0000
@@ -2625,11 +2625,13 @@
   (if (null comint-file-name-quote-list)
       filename
     (let ((regexp
-	   (format "\\(^\\|[^\\]\\)\\([%s]\\)"
+	   (format "[%s]"
 	    (mapconcat 'char-to-string comint-file-name-quote-list ""))))
       (save-match-data
-	(while (string-match regexp filename)
-	  (setq filename (replace-match "\\1\\\\\\2" nil nil filename)))
+	(let ((i 0))
+	  (while (string-match regexp filename i)
+	    (setq filename (replace-match "\\\\\\&" nil nil filename))
+	    (setq i (1+ (match-end 0)))))
 	filename))))
 
 (defun comint-unquote-filename (filename)