From 69c3500f9630db9b194cb82167d0fccef9efb9a1 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 4 Nov 2013 02:54:12 +0100 Subject: 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) --- src/misc1.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/misc1.c') diff --git a/src/misc1.c b/src/misc1.c index 2063d427e..c349015ba 100644 --- 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 */ + for (p1 = p2 = get_past_head(fname); *p2; ) /* find last part of path */ { - if (vim_ispathsep(*p2)) + 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. -- cgit v1.2.1