summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-02-14 00:13:20 +0000
committerRichard M. Stallman <rms@gnu.org>1995-02-14 00:13:20 +0000
commit58fc958791abf2408898924db9bad4459b3740b4 (patch)
treed1dee20f3ec1c484961139e3442028b47c6d44e5 /src/fileio.c
parent0ce62eb25051e553e90aa63cb18d9db8aa447260 (diff)
downloademacs-58fc958791abf2408898924db9bad4459b3740b4.tar.gz
(Fexpand_file_name): Copy default-directory
before looking for a handler on the directory arg.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c11
1 files 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.