emacs-devel
[Top][All Lists]
Advanced

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

Re: locate-dominating-file calls `stat' too eagerly


From: Stefan Monnier
Subject: Re: locate-dominating-file calls `stat' too eagerly
Date: Mon, 29 Sep 2008 16:45:22 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

>> > (defun locate-dominating-file (file regexp)
>> >   "Look up the directory hierarchy from FILE for a file matching REGEXP."
>> >   ;; If FILE does not exist, find its parent directory that does.
>> >   (or (file-exists-p file)
>> >       (while (and file (not (file-directory-p file)))
>> >         (setq file (file-name-directory (directory-file-name file)))))
>> In some corner cases, this can infloop.
> What are those cases?  I think we need to describe them in a comment
> there.

Can't remember, sadly.

>> > And btw, won't the user test cover the case of crossing ~/ as well?
>> In 99% of the cases, yes.
> What are the remaining 1%?  Again, I think they should be mentioned in
> comments.

These are too obvious to be worth mentioning: when the user owns ~/..
The most common such case I can think of is when the user is `root'.


        Stefan




reply via email to

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