unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#45540: 27.1; symbolic links crash dired
@ 2020-12-29 21:54 Devon Sean McCullough
  2020-12-30  3:34 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Devon Sean McCullough @ 2020-12-29 21:54 UTC (permalink / raw)
  To: 45540

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





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-01 15:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-29 21:54 bug#45540: 27.1; symbolic links crash dired Devon Sean McCullough
2020-12-30  3:34 ` Lars Ingebrigtsen
2021-01-23 22:48   ` Lars Ingebrigtsen
     [not found]     ` <a6d7e822-42e1-0d77-e314-06dd4be0c848@jovi.net>
2021-01-25 23:48       ` Lars Ingebrigtsen
2021-03-01 15:18     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).