diff options
| author | Richard M. Stallman | 1995-02-14 00:13:20 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-02-14 00:13:20 +0000 |
| commit | 58fc958791abf2408898924db9bad4459b3740b4 (patch) | |
| tree | d1dee20f3ec1c484961139e3442028b47c6d44e5 /src | |
| parent | 0ce62eb25051e553e90aa63cb18d9db8aa447260 (diff) | |
| download | emacs-58fc958791abf2408898924db9bad4459b3740b4.tar.gz emacs-58fc958791abf2408898924db9bad4459b3740b4.zip | |
(Fexpand_file_name): Copy default-directory
before looking for a handler on the directory arg.
Diffstat (limited to 'src')
| -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'.") | |||
| 745 | handler = Ffind_file_name_handler (name, Qexpand_file_name); | 745 | handler = Ffind_file_name_handler (name, Qexpand_file_name); |
| 746 | if (!NILP (handler)) | 746 | if (!NILP (handler)) |
| 747 | return call3 (handler, Qexpand_file_name, name, defalt); | 747 | return call3 (handler, Qexpand_file_name, name, defalt); |
| 748 | |||
| 749 | /* Use the buffer's default-directory if DEFALT is omitted. */ | ||
| 750 | if (NILP (defalt)) | ||
| 751 | defalt = current_buffer->directory; | ||
| 752 | CHECK_STRING (defalt, 1); | ||
| 753 | |||
| 748 | if (!NILP (defalt)) | 754 | if (!NILP (defalt)) |
| 749 | { | 755 | { |
| 750 | handler = Ffind_file_name_handler (defalt, Qexpand_file_name); | 756 | handler = Ffind_file_name_handler (defalt, Qexpand_file_name); |
| @@ -752,11 +758,6 @@ See also the function `substitute-in-file-name'.") | |||
| 752 | return call3 (handler, Qexpand_file_name, name, defalt); | 758 | return call3 (handler, Qexpand_file_name, name, defalt); |
| 753 | } | 759 | } |
| 754 | 760 | ||
| 755 | /* Use the buffer's default-directory if DEFALT is omitted. */ | ||
| 756 | if (NILP (defalt)) | ||
| 757 | defalt = current_buffer->directory; | ||
| 758 | CHECK_STRING (defalt, 1); | ||
| 759 | |||
| 760 | o = XSTRING (defalt)->data; | 761 | o = XSTRING (defalt)->data; |
| 761 | 762 | ||
| 762 | /* Make sure DEFALT is properly expanded. | 763 | /* Make sure DEFALT is properly expanded. |