summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorKai Großjohann <kgrossjo@eu.uu.net>2003-03-29 16:34:35 +0000
committerKai Großjohann <kgrossjo@eu.uu.net>2003-03-29 16:34:35 +0000
commitbeb402deed11deee9fdaddb986cc7c51c14082d0 (patch)
tree27d6ca2c53977f7437a37d2551ebc0bc68252d72 /src/fileio.c
parent753ad988908d6178893e5647cc227621b0eee8a9 (diff)
downloademacs-beb402deed11deee9fdaddb986cc7c51c14082d0.tar.gz
(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.c17
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'. */)
int is_escaped = 0;
#endif /* DOS_NT */
int length;
- Lisp_Object handler;
+ Lisp_Object handler, result;
CHECK_STRING (name);
@@ -1678,8 +1678,19 @@ See also the function `substitute-in-file-name'. */)
CORRECT_DIR_SEPS (target);
#endif /* DOS_NT */
- return make_specified_string (target, -1, o - target,
- STRING_MULTIBYTE (name));
+ result = make_specified_string (target, -1, o - target,
+ STRING_MULTIBYTE (name));
+
+ /* Again look to see if the file name has special constructs in it
+ and perhaps call the corresponding file handler. This is needed
+ for filenames such as "/foo/../user@host:/bar/../baz". Expanding
+ the ".." component gives us "/user@host:/bar/../baz" which needs
+ to be expanded again. */
+ handler = Ffind_file_name_handler (result, Qexpand_file_name);
+ if (!NILP (handler))
+ return call3 (handler, Qexpand_file_name, result, default_directory);
+
+ return result;
}
#if 0