summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/os_mswin.c14
-rw-r--r--src/os_win32.c3
-rw-r--r--src/version.c2
3 files changed, 16 insertions, 3 deletions
diff --git a/src/os_mswin.c b/src/os_mswin.c
index 95c3d1738..4b2f3cf07 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -617,8 +617,22 @@ vim_stat(const char *name, struct stat *stp)
p = buf + strlen(buf);
if (p > buf)
mb_ptr_back(buf, p);
+
+ /* Remove trailing '\\' except root path. */
if (p > buf && (*p == '\\' || *p == '/') && p[-1] != ':')
*p = NUL;
+
+ if ((buf[0] == '\\' && buf[1] == '\\') || (buf[0] == '/' && buf[1] == '/'))
+ {
+ /* UNC root path must be followed by '\\'. */
+ p = vim_strpbrk(buf + 2, "\\/");
+ if (p != NULL)
+ {
+ p = vim_strpbrk(p + 1, "\\/");
+ if (p == NULL)
+ STRCAT(buf, "\\");
+ }
+ }
#ifdef FEAT_MBYTE
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage
# ifdef __BORLANDC__
diff --git a/src/os_win32.c b/src/os_win32.c
index 5f671a7e9..b006a0db2 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -2890,9 +2890,6 @@ mch_getperm(char_u *name)
struct stat st;
int n;
- if (name[0] == '\\' && name[1] == '\\')
- /* UNC path */
- return (long)win32_getattrs(name);
n = mch_stat(name, &st);
return n == 0 ? (long)st.st_mode : -1L;
}
diff --git a/src/version.c b/src/version.c
index 3400e6b02..8eb9e4085 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 136,
+/**/
135,
/**/
134,