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'
|
* 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)
|
||||||
{
|
{
|
||||||
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;
|
||||||
|
@@ -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,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user