Skip to content

Commit 361cf1e

Browse files
committed
updated for version 7.4.096
Problem: Can't change directory to an UNC path. Solution: Use win32_getattrs() in mch_getperm(). (Christian Brabandt)
1 parent e2b2128 commit 361cf1e

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/os_win32.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2841,18 +2841,20 @@ mch_dirname(
28412841
}
28422842

28432843
/*
2844-
* get file permissions for `name'
2845-
* -1 : error
2846-
* else mode_t
2844+
* Get file permissions for "name".
2845+
* Return mode_t or -1 for error.
28472846
*/
28482847
long
28492848
mch_getperm(char_u *name)
28502849
{
28512850
struct stat st;
2852-
int n;
2851+
int n;
28532852

2853+
if (name[0] == '\\' && name[1] == '\\')
2854+
/* UNC path */
2855+
return (long)win32_getattrs(name);
28542856
n = mch_stat(name, &st);
2855-
return n == 0 ? (int)st.st_mode : -1;
2857+
return n == 0 ? (long)st.st_mode : -1L;
28562858
}
28572859

28582860

@@ -3094,8 +3096,7 @@ win32_fileinfo(char_u *fname, BY_HANDLE_FILE_INFORMATION *info)
30943096
* -1 : error
30953097
* else FILE_ATTRIBUTE_* defined in winnt.h
30963098
*/
3097-
static
3098-
int
3099+
static int
30993100
win32_getattrs(char_u *name)
31003101
{
31013102
int attr;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ static char *(features[]) =
738738

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
96,
741743
/**/
742744
95,
743745
/**/

0 commit comments

Comments
 (0)