Skip to content

Commit

Permalink
updated for version 7.4.096
Browse files Browse the repository at this point in the history
Problem:    Can't change directory to an UNC path.
Solution:   Use win32_getattrs() in mch_getperm(). (Christian Brabandt)
  • Loading branch information
brammool committed Nov 21, 2013
1 parent 49b1027 commit ffa2220
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/os_win32.c
Expand Up @@ -2841,18 +2841,20 @@ mch_dirname(
}

/*
* get file permissions for `name'
* -1 : error
* else mode_t
* Get file permissions for "name".
* Return mode_t or -1 for error.
*/
long
mch_getperm(char_u *name)
{
struct stat st;
int n;
int n;

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


Expand Down Expand Up @@ -3094,8 +3096,7 @@ win32_fileinfo(char_u *fname, BY_HANDLE_FILE_INFORMATION *info)
* -1 : error
* else FILE_ATTRIBUTE_* defined in winnt.h
*/
static
int
static int
win32_getattrs(char_u *name)
{
int attr;
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -738,6 +738,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
96,
/**/
95,
/**/
Expand Down

0 comments on commit ffa2220

Please sign in to comment.