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

* bug#45540: 27.1; symbolic links crash dired
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2020-12-30  3:34 UTC (permalink / raw)
  To: Devon Sean McCullough; +Cc: 45540

Devon Sean McCullough <Emacs-hacker2018@jovi.net> writes:

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

The patch looks reasonable -- but do you have a test case that
reproduces this bug (starting from "emacs -Q") so that we can verify the
bug and the fix?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#45540: 27.1; symbolic links crash dired
  2020-12-30  3:34 ` Lars Ingebrigtsen
@ 2021-01-23 22:48   ` Lars Ingebrigtsen
       [not found]     ` <a6d7e822-42e1-0d77-e314-06dd4be0c848@jovi.net>
  2021-03-01 15:18     ` Lars Ingebrigtsen
  0 siblings, 2 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-23 22:48 UTC (permalink / raw)
  To: Devon Sean McCullough; +Cc: 45540

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Devon Sean McCullough <Emacs-hacker2018@jovi.net> writes:
>
>> Here's a fix.  I did NOT check this carefully.
>> Dired crashes when (< (length file-name) (length root))
>
> The patch looks reasonable -- but do you have a test case that
> reproduces this bug (starting from "emacs -Q") so that we can verify the
> bug and the fix?

I tried various link scenarios to come up with a case where file-name
was shorter than root, and I was unable to.  Do you have a test case for
such a setup?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#45540: 27.1; symbolic links crash dired
       [not found]     ` <a6d7e822-42e1-0d77-e314-06dd4be0c848@jovi.net>
@ 2021-01-25 23:48       ` Lars Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-25 23:48 UTC (permalink / raw)
  To: Devon Sean McCullough; +Cc: 45540

(Please keep the debbugs address in the CC header; otherwise the mail
won't reach the bug tracker.)

Devon Sean McCullough <Emacs-hacker2018@jovi.net> writes:

> Before I patched it, dired was constantly crashing.
> I've unpatched it and (setq directory-abbrev-alist nil)
> but still no crash, mystery.  I'll keep digging.

Thanks.






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

* bug#45540: 27.1; symbolic links crash dired
  2021-01-23 22:48   ` Lars Ingebrigtsen
       [not found]     ` <a6d7e822-42e1-0d77-e314-06dd4be0c848@jovi.net>
@ 2021-03-01 15:18     ` Lars Ingebrigtsen
  1 sibling, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-03-01 15:18 UTC (permalink / raw)
  To: Devon Sean McCullough; +Cc: 45540

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I tried various link scenarios to come up with a case where file-name
> was shorter than root, and I was unable to.  Do you have a test case for
> such a setup?

More information was requested, but no response was given within a
month, so I'm closing this bug report.  If the problem still exists,
please respond to this email and we'll reopen the bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ 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).