diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-11-04 02:54:12 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-11-04 02:54:12 +0100 |
commit | 69c3500f9630db9b194cb82167d0fccef9efb9a1 (patch) | |
tree | 0bdefbe3e703fb42094a804b42adc82897e104d6 /src/misc1.c | |
parent | 332a2cadcd19a0ac69b9c41ed6f4add89128fdfe (diff) | |
download | vim-git-69c3500f9630db9b194cb82167d0fccef9efb9a1.tar.gz |
updated for version 7.4.066v7.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)
Diffstat (limited to 'src/misc1.c')
-rw-r--r-- | src/misc1.c | 21 |
1 files changed, 18 insertions, 3 deletions
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. |