]> code.delx.au - gnu-emacs/blobdiff - lisp/w32-fns.el
(inactivate-input-method): Set
[gnu-emacs] / lisp / w32-fns.el
index ab9c8d82212b227888ecd0d18f29595419b69c59..018390d4b4a8fe8867e0c973736f0055d05c90ec 100644 (file)
@@ -257,7 +257,8 @@ with a definition that really does change some file names."
   (let ((name (copy-sequence filename))
        (start 0))
     ;; leave ':' if part of drive specifier
-    (if (eq (aref name 1) ?:)
+    (if (and (> (length name) 1)
+            (eq (aref name 1) ?:))
        (setq start 2))
     ;; destructively replace invalid filename characters with !
     (while (string-match "[?*:<>|\"\000-\037]" name start)
@@ -265,11 +266,12 @@ with a definition that really does change some file names."
       (setq start (match-end 0)))
     ;; convert directory separators to Windows format
     ;; (but only if the shell in use requires it)
-    (if (w32-shell-dos-semantics)
-       (while (string-match "/" name start)
-         (aset name (match-beginning 0) ?\\)
-         (setq start (match-end 0))))
-      name))
+    (when (w32-shell-dos-semantics)
+      (setq start 0)
+      (while (string-match "/" name start)
+       (aset name (match-beginning 0) ?\\)
+       (setq start (match-end 0))))
+    name))
 
 ;;; Fix interface to (X-specific) mouse.el
 (defun x-set-selection (type data)