1
0
forked from aniani/vim

updated for version 7.4.096

Problem:    Can't change directory to an UNC path.
Solution:   Use win32_getattrs() in mch_getperm(). (Christian Brabandt)
This commit is contained in:
Bram Moolenaar
2013-11-21 12:34:11 +01:00
parent 49b10273f0
commit ffa2220950
2 changed files with 10 additions and 7 deletions

View File

@@ -2841,9 +2841,8 @@ mch_dirname(
} }
/* /*
* get file permissions for `name' * Get file permissions for "name".
* -1 : error * Return mode_t or -1 for error.
* else mode_t
*/ */
long long
mch_getperm(char_u *name) mch_getperm(char_u *name)
@@ -2851,8 +2850,11 @@ mch_getperm(char_u *name)
struct stat st; struct stat st;
int n; int n;
if (name[0] == '\\' && name[1] == '\\')
/* UNC path */
return (long)win32_getattrs(name);
n = mch_stat(name, &st); n = mch_stat(name, &st);
return n == 0 ? (int)st.st_mode : -1; return n == 0 ? (long)st.st_mode : -1L;
} }
@@ -3094,8 +3096,7 @@ win32_fileinfo(char_u *fname, BY_HANDLE_FILE_INFORMATION *info)
* -1 : error * -1 : error
* else FILE_ATTRIBUTE_* defined in winnt.h * else FILE_ATTRIBUTE_* defined in winnt.h
*/ */
static static int
int
win32_getattrs(char_u *name) win32_getattrs(char_u *name)
{ {
int attr; int attr;

View File

@@ -738,6 +738,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
96,
/**/ /**/
95, 95,
/**/ /**/