summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2001-09-13 12:41:41 +0000
committerEli Zaretskii <eliz@gnu.org>2001-09-13 12:41:41 +0000
commit15233548eef90383d186130f45582a6034ed8e49 (patch)
tree74a7cf7d9d2f0d8b35f4014a745d1e597ea3f35e /lisp/files.el
parent66a863f0594303f9d741306110f896c1af9b71ac (diff)
downloademacs-15233548eef90383d186130f45582a6034ed8e49.tar.gz
(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.
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 9964f708100..bdd5604417d 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3264,7 +3264,12 @@ See also `auto-save-file-name-p'."
(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)