emacs-devel
[Top][All Lists]
Advanced

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

Re: Build failure on M$ (using MSVC): Patch enclosed


From: dhruva
Subject: Re: Build failure on M$ (using MSVC): Patch enclosed
Date: Tue, 20 May 2008 17:27:19 +0530

diff --git a/lisp/files.el b/lisp/files.el
index ee5efe4..48b992b 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3120,8 +3120,9 @@ If the file is in a registered project, a cons from
 `project-directory-alist' is returned.
 Otherwise this returns nil."
   (let ((dir (file-name-directory file))
+       (prev "")
        (result nil))
-    (while (and (not (string= dir "/"))
+    (while (and (not (string= dir prev))
                (not result))
       (cond
        ((setq result (assoc dir project-directory-alist))
@@ -3130,6 +3131,7 @@ Otherwise this returns nil."
        ((file-exists-p (expand-file-name ".dir-settings.el" dir))
        (setq result (expand-file-name ".dir-settings.el" dir)))
        (t
+       (setq prev dir)
        (setq dir (file-name-directory (directory-file-name dir))))))
     result))


On Tue, May 20, 2008 at 3:51 PM, David Kastrup <address@hidden> wrote:
> Jason Rumney <address@hidden> writes:
>
>> dhruva wrote:
>>> The below patch fixes the bug of infinite looping.
>>>
>>> diff --git a/lisp/files.el b/lisp/files.el
>>> index ee5efe4..c680d32 100644
>>> --- a/lisp/files.el
>>> +++ b/lisp/files.el
>>> @@ -3120,8 +3120,9 @@ If the file is in a registered project, a cons from
>>>  `project-directory-alist' is returned.
>>>  Otherwise this returns nil."
>>>    (let ((dir (file-name-directory file))
>>> +       (root (expand-file-name "/"))
>>>         (result nil))
>>> -    (while (and (not (string= dir "/"))
>>> +    (while (and (not (string= dir root))
>>>                 (not result))
>>>        (cond
>>>         ((setq result (assoc dir project-directory-alist))
>>>
>>
>> I don't think this is sufficient for the case when the current
>> directory is say "C:/some_dir/" and file is "D:/file.txt"


The above patch stores the previous value as sugg by DAK.

-dk

-- 
Contents reflect my personal views only!




reply via email to

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