From 58fc958791abf2408898924db9bad4459b3740b4 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 14 Feb 1995 00:13:20 +0000 Subject: [PATCH] (Fexpand_file_name): Copy default-directory before looking for a handler on the directory arg. --- src/fileio.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/fileio.c b/src/fileio.c index 3bfe54b15ee..8a13ce5f39a 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -745,6 +745,12 @@ See also the function `substitute-in-file-name'.") handler = Ffind_file_name_handler (name, Qexpand_file_name); if (!NILP (handler)) return call3 (handler, Qexpand_file_name, name, defalt); + + /* Use the buffer's default-directory if DEFALT is omitted. */ + if (NILP (defalt)) + defalt = current_buffer->directory; + CHECK_STRING (defalt, 1); + if (!NILP (defalt)) { handler = Ffind_file_name_handler (defalt, Qexpand_file_name); @@ -752,11 +758,6 @@ See also the function `substitute-in-file-name'.") return call3 (handler, Qexpand_file_name, name, defalt); } - /* Use the buffer's default-directory if DEFALT is omitted. */ - if (NILP (defalt)) - defalt = current_buffer->directory; - CHECK_STRING (defalt, 1); - o = XSTRING (defalt)->data; /* Make sure DEFALT is properly expanded. -- 2.11.4.GIT