diff options
| author | Andreas Schwab | 2003-12-24 10:05:31 +0000 |
|---|---|---|
| committer | Andreas Schwab | 2003-12-24 10:05:31 +0000 |
| commit | 702b4f7f9b7ca7436fe6d2142c143e77f5ee25c5 (patch) | |
| tree | c9ae146b868fe473914d5ae3aabeaedf4d836862 | |
| parent | 8babaa59603bad912ca7fdefe1d83ede41c01fd2 (diff) | |
| download | emacs-702b4f7f9b7ca7436fe6d2142c143e77f5ee25c5.tar.gz emacs-702b4f7f9b7ca7436fe6d2142c143e77f5ee25c5.zip | |
(comint-quote-filename): Correctly handle backslash
in comint-file-name-quote-list.
| -rw-r--r-- | lisp/comint.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index 8405e8afcb6..5509e71d984 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -2625,11 +2625,13 @@ Magic characters are those in `comint-file-name-quote-list'." | |||
| 2625 | (if (null comint-file-name-quote-list) | 2625 | (if (null comint-file-name-quote-list) |
| 2626 | filename | 2626 | filename |
| 2627 | (let ((regexp | 2627 | (let ((regexp |
| 2628 | (format "\\(^\\|[^\\]\\)\\([%s]\\)" | 2628 | (format "[%s]" |
| 2629 | (mapconcat 'char-to-string comint-file-name-quote-list "")))) | 2629 | (mapconcat 'char-to-string comint-file-name-quote-list "")))) |
| 2630 | (save-match-data | 2630 | (save-match-data |
| 2631 | (while (string-match regexp filename) | 2631 | (let ((i 0)) |
| 2632 | (setq filename (replace-match "\\1\\\\\\2" nil nil filename))) | 2632 | (while (string-match regexp filename i) |
| 2633 | (setq filename (replace-match "\\\\\\&" nil nil filename)) | ||
| 2634 | (setq i (1+ (match-end 0))))) | ||
| 2633 | filename)))) | 2635 | filename)))) |
| 2634 | 2636 | ||
| 2635 | (defun comint-unquote-filename (filename) | 2637 | (defun comint-unquote-filename (filename) |