diff options
| author | Eli Zaretskii | 2006-12-22 23:32:24 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2006-12-22 23:32:24 +0000 |
| commit | 45b8a4013430f70e5a0de31fd3650707c486a330 (patch) | |
| tree | c58ccfcabd13bc5544ad92a1b268d62fc17cfdc2 | |
| parent | 8f9184890206bdca70cc2ea06c993d076c39134e (diff) | |
| download | emacs-45b8a4013430f70e5a0de31fd3650707c486a330.tar.gz emacs-45b8a4013430f70e5a0de31fd3650707c486a330.zip | |
(convert-standard-filename): Wrap in save-match-data.
| -rw-r--r-- | lisp/w32-fns.el | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el index 21b75223060..e73aa0d696d 100644 --- a/lisp/w32-fns.el +++ b/lisp/w32-fns.el | |||
| @@ -240,28 +240,28 @@ On Windows and DOS, replace invalid characters. On DOS, make | |||
| 240 | sure to obey the 8.3 limitations. On Windows, turn Cygwin names | 240 | sure to obey the 8.3 limitations. On Windows, turn Cygwin names |
| 241 | into native names, and also turn slashes into backslashes if the | 241 | into native names, and also turn slashes into backslashes if the |
| 242 | shell requires it (see `w32-shell-dos-semantics')." | 242 | shell requires it (see `w32-shell-dos-semantics')." |
| 243 | (let ((name | 243 | (save-match-data |
| 244 | (save-match-data | 244 | (let ((name |
| 245 | (if (string-match "\\`/cygdrive/\\([a-zA-Z]\\)/" filename) | 245 | (if (string-match "\\`/cygdrive/\\([a-zA-Z]\\)/" filename) |
| 246 | (replace-match "\\1:/" t nil filename) | 246 | (replace-match "\\1:/" t nil filename) |
| 247 | (copy-sequence filename)))) | 247 | (copy-sequence filename))) |
| 248 | (start 0)) | 248 | (start 0)) |
| 249 | ;; leave ':' if part of drive specifier | 249 | ;; leave ':' if part of drive specifier |
| 250 | (if (and (> (length name) 1) | 250 | (if (and (> (length name) 1) |
| 251 | (eq (aref name 1) ?:)) | 251 | (eq (aref name 1) ?:)) |
| 252 | (setq start 2)) | 252 | (setq start 2)) |
| 253 | ;; destructively replace invalid filename characters with ! | 253 | ;; destructively replace invalid filename characters with ! |
| 254 | (while (string-match "[?*:<>|\"\000-\037]" name start) | 254 | (while (string-match "[?*:<>|\"\000-\037]" name start) |
| 255 | (aset name (match-beginning 0) ?!) | 255 | (aset name (match-beginning 0) ?!) |
| 256 | (setq start (match-end 0))) | 256 | (setq start (match-end 0))) |
| 257 | ;; convert directory separators to Windows format | 257 | ;; convert directory separators to Windows format |
| 258 | ;; (but only if the shell in use requires it) | 258 | ;; (but only if the shell in use requires it) |
| 259 | (when (w32-shell-dos-semantics) | 259 | (when (w32-shell-dos-semantics) |
| 260 | (setq start 0) | 260 | (setq start 0) |
| 261 | (while (string-match "/" name start) | 261 | (while (string-match "/" name start) |
| 262 | (aset name (match-beginning 0) ?\\) | 262 | (aset name (match-beginning 0) ?\\) |
| 263 | (setq start (match-end 0)))) | 263 | (setq start (match-end 0)))) |
| 264 | name)) | 264 | name))) |
| 265 | 265 | ||
| 266 | ;;; Fix interface to (X-specific) mouse.el | 266 | ;;; Fix interface to (X-specific) mouse.el |
| 267 | (defun x-set-selection (type data) | 267 | (defun x-set-selection (type data) |