aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Großjohann2003-03-29 16:34:35 +0000
committerKai Großjohann2003-03-29 16:34:35 +0000
commitbeb402deed11deee9fdaddb986cc7c51c14082d0 (patch)
tree27d6ca2c53977f7437a37d2551ebc0bc68252d72
parent753ad988908d6178893e5647cc227621b0eee8a9 (diff)
downloademacs-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".
-rw-r--r--src/ChangeLog8
-rw-r--r--src/fileio.c17
2 files changed, 22 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f79e1633722..accad5d2ede 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12003-03-29 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net>
2
3 * fileio.c (Fexpand_file_name): In the no-handler case, after
4 expanding, look again for a handler and invoke it. This is needed
5 for filenames like "/foo/../user@host:/bar/../baz" -- the first
6 expansion produces "/user@host:/bar/../baz" which needs to be
7 expanded again for the finame result "/user@host:/baz".
8
12003-03-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 92003-03-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 10
3 * gtkutil.c (xg_tool_bar_item_expose_callback): Reduce size 11 * gtkutil.c (xg_tool_bar_item_expose_callback): Reduce size
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