diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-08-17 16:21:36 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-08-17 16:22:10 -0700 |
commit | 362ca83a3b9d74c51ac325a6490551272aa25f9a (patch) | |
tree | 2eb2670a231025a5aa18cc56b130a3ac487648e9 /lisp/startup.el | |
parent | dd989c0ea0c514a130270d5a1aefbdafe7fafc66 (diff) | |
download | emacs-362ca83a3b9d74c51ac325a6490551272aa25f9a.tar.gz |
Let Emacs start even if curdir is inaccessible
* lisp/startup.el (normal-top-level): Also delete PWD if
file-attributes fails for either $PWD or default-directory,
instead of failing out of the top level.
This fixes a regression from Emacs 26 (Bug#42903).
Diffstat (limited to 'lisp/startup.el')
-rw-r--r-- | lisp/startup.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index bff10003f84..364689ccdbf 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -649,11 +649,12 @@ It is the default value of the variable `top-level'." ;; Use FOO/., so that if FOO is a symlink, file-attributes ;; describes the directory linked to, not FOO itself. (or (and default-directory - (equal (file-attributes - (concat (file-name-as-directory pwd) ".")) - (file-attributes - (concat (file-name-as-directory default-directory) - ".")))) + (ignore-errors + (equal (file-attributes + (concat (file-name-as-directory pwd) ".")) + (file-attributes + (concat (file-name-as-directory default-directory) + "."))))) (setq process-environment (delete (concat "PWD=" pwd) process-environment))))) |