1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2013-11-04 02:54:12 +01:00
parent 332a2cadcd
commit 69c3500f96
4 changed files with 62 additions and 16 deletions

View File

@@ -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.