From: Richard M. Stallman Date: Tue, 14 Feb 1995 00:13:20 +0000 (+0000) Subject: (Fexpand_file_name): Copy default-directory X-Git-Tag: emacs-19.34~5124 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=58fc958791abf2408898924db9bad4459b3740b4;p=emacs.git (Fexpand_file_name): Copy default-directory before looking for a handler on the directory arg. --- 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.