unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44968: 28.0.50; [feature/native-comp] Emacs segfault in `rustic-flycheck-dirs-list'
@ 2020-11-30 19:56 Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-11-30 23:19 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 6+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-11-30 19:56 UTC (permalink / raw)
  To: 44968; +Cc: Gerry Agbobada

Reported by Gerry Agbobada,

reproducer:

============
;; -*- lexical-binding: t -*-

(defun rustic-flycheck-dirs-list (start end)
  "Return a list of directories from START (inclusive) to END (exclusive).
E.g., if START is '/a/b/c/d' and END is '/a', return the list
'(/a/b/c/d /a/b/c /a/b) in this order.
START and END are strings representing file paths.  END should be
above START in the file hierarchy; if not, the list stops at the
root of the file hierarchy."
  (let ((dirlist)
        (dir (expand-file-name start))
        (end (expand-file-name end)))
    (while (not (or (equal dir (car dirlist)) ; avoid infinite loop
                    (file-equal-p dir end)))
      (push dir dirlist)
      (setq dir (directory-file-name (file-name-directory dir))))
    (nreverse dirlist)))

(native-compile #'rustic-flycheck-dirs-list)

(message "%s" (rustic-flycheck-dirs-list "/tmp/test/foo" "/tmp"))

===========






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

end of thread, other threads:[~2020-12-01 13:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-30 19:56 bug#44968: 28.0.50; [feature/native-comp] Emacs segfault in `rustic-flycheck-dirs-list' Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-30 23:19 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-30 23:37   ` Gerry Agbobada
2020-12-01  9:14     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-12-01 11:07       ` Gerry Agbobada
2020-12-01 13:16         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors

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