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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
@@ -738,6 +738,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
96,
|
||||
/**/
|
||||
95,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user