# HG changeset patch # User Eli Zaretskii # Date 1000384830 0 # Node ID 7381e244a6523005f331db7195d0457f4ba32f7c # Parent 58cf0f94588133e0382718e78ddb9786535da433 (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. diff -r 58cf0f945881 -r 7381e244a652 lisp/files.el --- 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)