forked from aniani/vim
patch 7.4.1114
Problem: delete() does not work well with symbolic links. Solution: Recognize symbolik links.
This commit is contained in:
@@ -2994,7 +2994,7 @@ mch_hide(name)
|
||||
}
|
||||
|
||||
/*
|
||||
* return TRUE if "name" is a directory
|
||||
* return TRUE if "name" is a directory or a symlink to a directory
|
||||
* return FALSE if "name" is not a directory
|
||||
* return FALSE for error
|
||||
*/
|
||||
@@ -3015,6 +3015,28 @@ mch_isdir(name)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* return TRUE if "name" is a directory, NOT a symlink to a directory
|
||||
* return FALSE if "name" is not a directory
|
||||
* return FALSE for error
|
||||
*/
|
||||
int
|
||||
mch_isrealdir(name)
|
||||
char_u *name;
|
||||
{
|
||||
struct stat statb;
|
||||
|
||||
if (*name == NUL) /* Some stat()s don't flag "" as an error. */
|
||||
return FALSE;
|
||||
if (lstat((char *)name, &statb))
|
||||
return FALSE;
|
||||
#ifdef _POSIX_SOURCE
|
||||
return (S_ISDIR(statb.st_mode) ? TRUE : FALSE);
|
||||
#else
|
||||
return ((statb.st_mode & S_IFMT) == S_IFDIR ? TRUE : FALSE);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int executable_file __ARGS((char_u *name));
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user