1
0
forked from aniani/vim

patch 8.1.0268: file type checking has too many #ifdef

Problem:    File type checking has too many #ifdef.
Solution:   Always define the S_IF macros. (Ken Takata, closes #3306)
This commit is contained in:
Bram Moolenaar
2018-08-11 13:57:20 +02:00
parent 90f1e2b7bc
commit d569bb0299
8 changed files with 58 additions and 108 deletions

View File

@@ -3138,11 +3138,7 @@ mch_isdir(char_u *name)
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
}
/*
@@ -3159,11 +3155,7 @@ mch_isrealdir(char_u *name)
return FALSE;
if (mch_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(char_u *name);