(convert-standard-filename): Do length check on name
authorAndrew Innes <andrewi@gnu.org>
Tue, 2 Jan 2001 22:38:06 +0000 (22:38 +0000)
committerAndrew Innes <andrewi@gnu.org>
Tue, 2 Jan 2001 22:38:06 +0000 (22:38 +0000)
before aref.

lisp/w32-fns.el

index ab9c8d8..8e0e85d 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)