mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 22:38:16 +00:00
Port mch_isdir to libuv.
This commit is contained in:

committed by
Thiago de Arruda

parent
1e5a6acebd
commit
8bb672e6a0
@@ -1319,26 +1319,6 @@ void mch_hide(char_u *name)
|
||||
/* can't hide a file */
|
||||
}
|
||||
|
||||
/*
|
||||
* return TRUE if "name" is a directory
|
||||
* return FALSE if "name" is not a directory
|
||||
* return FALSE for error
|
||||
*/
|
||||
int mch_isdir(char_u *name)
|
||||
{
|
||||
struct stat statb;
|
||||
|
||||
if (*name == NUL) /* Some stat()s don't flag "" as an error. */
|
||||
return FALSE;
|
||||
if (stat((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
|
||||
}
|
||||
|
||||
int executable_file(char_u *name);
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user