]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix PWD startup checking with symlinks
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 26 Aug 2020 17:53:32 +0000 (10:53 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 26 Aug 2020 20:27:56 +0000 (13:27 -0700)
* 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

index d9682eef4c88009d75daea2282d076638697796c..48274830763f5e2fad76f0e7e7079df43ee6ce54 100644 (file)
@@ -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)))))