diff options
author | Eli Zaretskii <eliz@gnu.org> | 2022-06-12 13:03:32 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2022-06-12 13:03:32 +0300 |
commit | dc5f6dcee22982906eb09037ee04471b34bb4be7 (patch) | |
tree | f21cab12d851a481dd67c423af087455d98a288c /lisp | |
parent | 5bf409329b1b678c633c79456288a1c4d6f0e804 (diff) | |
download | emacs-dc5f6dcee22982906eb09037ee04471b34bb4be7.tar.gz emacs-dc5f6dcee22982906eb09037ee04471b34bb4be7.tar.bz2 emacs-dc5f6dcee22982906eb09037ee04471b34bb4be7.zip |
Fix "C-x C-d" with wildcard arguments
* lisp/files.el (list-directory): Make sure 'default-directory' is
set to a valid value if the argument DIRNAME included wildcards.
(Bug#55877)
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/files.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el index 75a856c6362..945b7ef7371 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -7406,9 +7406,9 @@ and `list-directory-verbose-switches'." ;; Finishing with-output-to-temp-buffer seems to clobber default-directory. (with-current-buffer buffer (setq default-directory - (if (file-directory-p dirname) + (if (file-accessible-directory-p dirname) (file-name-as-directory dirname) - (file-name-directory dirname)))))) + (file-name-directory (directory-file-name dirname))))))) (defun shell-quote-wildcard-pattern (pattern) "Quote characters special to the shell in PATTERN, leave wildcards alone. |