]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fexpand_file_name): Copy default-directory
authorRichard M. Stallman <rms@gnu.org>
Tue, 14 Feb 1995 00:13:20 +0000 (00:13 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 14 Feb 1995 00:13:20 +0000 (00:13 +0000)
before looking for a handler on the directory arg.

src/fileio.c

index 3bfe54b15ee227c1159da3cf682ceb2719755440..8a13ce5f39a47d0bf5f720ae0f1dc8fd4c02f0a6 100644 (file)
@@ -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.