diff options
| author | Eli Zaretskii | 2022-06-12 13:03:32 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2022-06-12 13:03:32 +0300 |
| commit | dc5f6dcee22982906eb09037ee04471b34bb4be7 (patch) | |
| tree | f21cab12d851a481dd67c423af087455d98a288c | |
| parent | 5bf409329b1b678c633c79456288a1c4d6f0e804 (diff) | |
| download | emacs-dc5f6dcee22982906eb09037ee04471b34bb4be7.tar.gz 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)
| -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'." | |||
| 7406 | ;; Finishing with-output-to-temp-buffer seems to clobber default-directory. | 7406 | ;; Finishing with-output-to-temp-buffer seems to clobber default-directory. |
| 7407 | (with-current-buffer buffer | 7407 | (with-current-buffer buffer |
| 7408 | (setq default-directory | 7408 | (setq default-directory |
| 7409 | (if (file-directory-p dirname) | 7409 | (if (file-accessible-directory-p dirname) |
| 7410 | (file-name-as-directory dirname) | 7410 | (file-name-as-directory dirname) |
| 7411 | (file-name-directory dirname)))))) | 7411 | (file-name-directory (directory-file-name dirname))))))) |
| 7412 | 7412 | ||
| 7413 | (defun shell-quote-wildcard-pattern (pattern) | 7413 | (defun shell-quote-wildcard-pattern (pattern) |
| 7414 | "Quote characters special to the shell in PATTERN, leave wildcards alone. | 7414 | "Quote characters special to the shell in PATTERN, leave wildcards alone. |