changeset 39275:7381e244a652

(make-auto-save-file-name): If long file names are not supported, truncate the file name to DOS 8+3 limits before generating an auto-save file name from it.
author Eli Zaretskii <eliz@gnu.org>
date Thu, 13 Sep 2001 12:40:30 +0000
parents 58cf0f945881
children fd3e413c477a
files lisp/files.el
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Thu Sep 13 10:12:45 2001 +0000
+++ b/lisp/files.el	Thu Sep 13 12:40:30 2001 +0000
@@ -3264,7 +3264,12 @@
 
 	(if (and (eq system-type 'ms-dos)
 		 (not (msdos-long-file-names)))
-	    (let ((fn (file-name-nondirectory buffer-file-name)))
+	    ;; We truncate the file name to DOS 8+3 limits before
+	    ;; doing anything else, because the regexp passed to
+	    ;; string-match below cannot handle extensions longer than
+	    ;; 3 characters, multiple dots, and other atrocities.
+	    (let ((fn (dos-8+3-filename
+		       (file-name-nondirectory buffer-file-name))))
 	      (string-match "\\`\\([^.]+\\)\\(\\.\\(..?\\)?.?\\|\\)\\'" fn)
 	      (concat (file-name-directory buffer-file-name)
 		      "#" (match-string 1 fn)