diff options
author | Richard M. Stallman <rms@gnu.org> | 1995-02-14 00:13:20 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1995-02-14 00:13:20 +0000 |
commit | d7a34887c40ab67f25f6aa6d841f0da6b0ae27d8 (patch) | |
tree | 29df60d42f25bcad44b90f0391c05f4191d1a494 /src/fileio.c | |
parent | 7f6278186c2ed09a5eb0bad3fe180e91d5e1a42f (diff) | |
download | emacs-d7a34887c40ab67f25f6aa6d841f0da6b0ae27d8.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.c | 11 |
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. |