Mercurial > vim
diff src/misc1.c @ 5432:38b948f534e4 v7.4.066
updated for version 7.4.066
Problem: MS-Windows: When there is a colon in the file name (sub-stream
feature) the swap file name is wrong.
Solution: Change the colon to "%". (Yasuhiro Matsumoto)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Mon, 04 Nov 2013 02:54:12 +0100 |
parents | b9c1c1f4cda9 |
children | 878ed73c7070 |
line wrap: on
line diff
--- a/src/misc1.c +++ b/src/misc1.c @@ -4808,9 +4808,9 @@ gettail(fname) if (fname == NULL) return (char_u *)""; - for (p1 = p2 = fname; *p2; ) /* find last part of path */ - { - if (vim_ispathsep(*p2)) + for (p1 = p2 = get_past_head(fname); *p2; ) /* find last part of path */ + { + if (vim_ispathsep_nocolon(*p2)) p1 = p2 + 1; mb_ptr_adv(p2); } @@ -4929,7 +4929,8 @@ get_past_head(path) } /* - * return TRUE if 'c' is a path separator. + * Return TRUE if 'c' is a path separator. + * Note that for MS-Windows this includes the colon. */ int vim_ispathsep(c) @@ -4952,6 +4953,20 @@ vim_ispathsep(c) #endif } +/* + * Like vim_ispathsep(c), but exclude the colon for MS-Windows. + */ + int +vim_ispathsep_nocolon(c) + int c; +{ + return vim_ispathsep(c) +#ifdef BACKSLASH_IN_FILENAME + && c != ':' +#endif + ; +} + #if defined(FEAT_SEARCHPATH) || defined(PROTO) /* * return TRUE if 'c' is a path list separator.