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)
diff --git a/src/misc1.c b/src/misc1.c
index 2063d42..c349015 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -4808,9 +4808,9 @@
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 @@
}
/*
- * 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 @@
#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.