From be417b22ba0628c2f99a4e32c7bf2027f8975196 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 3 Sep 1997 22:31:25 +0000 Subject: [PATCH] (dired-get-filename): Don't call encode-coding-string if FILE is nil. --- lisp/dired.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/dired.el b/lisp/dired.el index e3273f732f0..f01349a361a 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1299,8 +1299,8 @@ Optional arg NO-ERROR-IF-NOT-FILEP means return nil if no filename on "\\([^\\]\\|\\`\\)\"" file "\\1\\\\\"" nil t) file) "\""))))) - (if buffer-file-coding-system - (setq file (encode-coding-string file buffer-file-coding-system))) + (and file buffer-file-coding-system + (setq file (encode-coding-string file buffer-file-coding-system))) (if (eq localp 'no-dir) file (and file (concat (dired-current-directory localp) file))))) -- 2.39.2