comparison src/fileio.c @ 50340:810c2ac4b064

(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".
author Kai Großjohann <kgrossjo@eu.uu.net>
date Sat, 29 Mar 2003 16:34:35 +0000
parents f72d2bd8118d
children 15f94db27199
comparison
equal deleted inserted replaced
50339:b8ecb0403fa1 50340:810c2ac4b064
1024 int drive = 0; 1024 int drive = 0;
1025 int collapse_newdir = 1; 1025 int collapse_newdir = 1;
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
1033 /* If the file name has special constructs in it, 1033 /* If the file name has special constructs in it,
1034 call the corresponding file handler. */ 1034 call the corresponding file handler. */
1676 target[1] = ':'; 1676 target[1] = ':';
1677 } 1677 }
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
1686 /* PLEASE DO NOT DELETE THIS COMMENTED-OUT VERSION! 1697 /* PLEASE DO NOT DELETE THIS COMMENTED-OUT VERSION!
1687 This is the old version of expand-file-name, before it was thoroughly 1698 This is the old version of expand-file-name, before it was thoroughly