emacs-diffs
[Top][All Lists]
Advanced

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

master ff864be 2/3: Fix PWD startup checking with symlinks


From: Paul Eggert
Subject: master ff864be 2/3: Fix PWD startup checking with symlinks
Date: Wed, 26 Aug 2020 16:28:02 -0400 (EDT)

branch: master
commit ff864be694247e5f6c8732afcbaeb1c0a8a8a124
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    Fix PWD startup checking with symlinks
    
    * lisp/startup.el (normal-top-level): Do not put "." after "/";
    it’s not needed and with current file-name-as-directory it does
    the wrong thing if PWD is a symlink.
---
 lisp/startup.el | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/lisp/startup.el b/lisp/startup.el
index d9682ee..4827483 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -642,16 +642,13 @@ It is the default value of the variable `top-level'."
         (list (default-value 'user-full-name)))
     ;; If the PWD environment variable isn't accurate, delete it.
     (let ((pwd (getenv "PWD")))
-      (and (stringp pwd)
-          ;; Use FOO/., so that if FOO is a symlink, file-attributes
-          ;; describes the directory linked to, not FOO itself.
+      (and pwd
           (or (and default-directory
                    (ignore-errors
                      (equal (file-attributes
-                             (concat (file-name-as-directory pwd) "."))
+                             (file-name-as-directory pwd))
                             (file-attributes
-                             (concat (file-name-as-directory default-directory)
-                                     ".")))))
+                             (file-name-as-directory default-directory)))))
               (setq process-environment
                     (delete (concat "PWD=" pwd)
                             process-environment)))))



reply via email to

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