bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#45540: 27.1; symbolic links crash dired


From: Devon Sean McCullough
Subject: bug#45540: 27.1; symbolic links crash dired
Date: Tue, 29 Dec 2020 16:54:15 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

Here's a fix.  I did NOT check this carefully.
Dired crashes when (< (length file-name) (length root))

diff -aBbdu --label /Applications/Emacs-27.1.app/Contents/Resources/lisp/files.el.gz --label \#\<buffer\ files.el.gz\> /var/folders/jv/9lctn91j0xqfv3f2kxc1lxx80000gn/T/jka-comtv7p5N /var/folders/jv/9lctn91j0xqfv3f2kxc1lxx80000gn/T/buffer-content-fatCkh
--- /Applications/Emacs-27.1.app/Contents/Resources/lisp/files.el.gz
+++ #<buffer files.el.gz>
@@ -4019,10 +4019,9 @@
   (let* ((file-name (or (buffer-file-name)
                        ;; Handle non-file buffers, too.
                        (expand-file-name default-directory)))
-        (sub-file-name (if (and file-name
+        (sub-file-name (when (and file-name
                                  (file-name-absolute-p file-name))
-                            ;; FIXME: Why not use file-relative-name?
-                           (substring file-name (length root)))))
+                         (file-relative-name file-name root))))
     (condition-case err
         (dolist (entry class-variables variables)
           (let ((key (car entry)))

Diff finished.  Tue Dec 29 16:42:36 2020





reply via email to

[Prev in Thread] Current Thread [Next in Thread]