diff options
| author | Kai Großjohann | 2003-03-29 16:34:35 +0000 |
|---|---|---|
| committer | Kai Großjohann | 2003-03-29 16:34:35 +0000 |
| commit | beb402deed11deee9fdaddb986cc7c51c14082d0 (patch) | |
| tree | 27d6ca2c53977f7437a37d2551ebc0bc68252d72 /src/fileio.c | |
| parent | 753ad988908d6178893e5647cc227621b0eee8a9 (diff) | |
| download | emacs-beb402deed11deee9fdaddb986cc7c51c14082d0.tar.gz emacs-beb402deed11deee9fdaddb986cc7c51c14082d0.zip | |
(Fexpand_file_name): In the no-handler case, after
expanding, look again for a handler and invoke it. This is needed
for filenames like "/foo/../user@host:/bar/../baz" -- the first
expansion produces "/user@host:/bar/../baz" which needs to be
expanded again for the finame result "/user@host:/baz".
Diffstat (limited to 'src/fileio.c')
| -rw-r--r-- | src/fileio.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/fileio.c b/src/fileio.c index 4f85aa1d6ad..c11a6f6292d 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -1026,7 +1026,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1026 | int is_escaped = 0; | 1026 | int is_escaped = 0; |
| 1027 | #endif /* DOS_NT */ | 1027 | #endif /* DOS_NT */ |
| 1028 | int length; | 1028 | int length; |
| 1029 | Lisp_Object handler; | 1029 | Lisp_Object handler, result; |
| 1030 | 1030 | ||
| 1031 | CHECK_STRING (name); | 1031 | CHECK_STRING (name); |
| 1032 | 1032 | ||
| @@ -1678,8 +1678,19 @@ See also the function `substitute-in-file-name'. */) | |||
| 1678 | CORRECT_DIR_SEPS (target); | 1678 | CORRECT_DIR_SEPS (target); |
| 1679 | #endif /* DOS_NT */ | 1679 | #endif /* DOS_NT */ |
| 1680 | 1680 | ||
| 1681 | return make_specified_string (target, -1, o - target, | 1681 | result = make_specified_string (target, -1, o - target, |
| 1682 | STRING_MULTIBYTE (name)); | 1682 | STRING_MULTIBYTE (name)); |
| 1683 | |||
| 1684 | /* Again look to see if the file name has special constructs in it | ||
| 1685 | and perhaps call the corresponding file handler. This is needed | ||
| 1686 | for filenames such as "/foo/../user@host:/bar/../baz". Expanding | ||
| 1687 | the ".." component gives us "/user@host:/bar/../baz" which needs | ||
| 1688 | to be expanded again. */ | ||
| 1689 | handler = Ffind_file_name_handler (result, Qexpand_file_name); | ||
| 1690 | if (!NILP (handler)) | ||
| 1691 | return call3 (handler, Qexpand_file_name, result, default_directory); | ||
| 1692 | |||
| 1693 | return result; | ||
| 1683 | } | 1694 | } |
| 1684 | 1695 | ||
| 1685 | #if 0 | 1696 | #if 0 |