Mercurial > vim
diff src/os_unix.c @ 14509:80f715651c4c v8.1.0268
patch 8.1.0268: file type checking has too many #ifdef
commit https://github.com/vim/vim/commit/d569bb029983cff947dce704e6f830276204c13f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 11 13:57:20 2018 +0200
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 https://github.com/vim/vim/issues/3306)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 11 Aug 2018 14:00:05 +0200 |
parents | 3375a8cbb442 |
children | 738e9d1ac4d2 |
line wrap: on
line diff
--- a/src/os_unix.c +++ b/src/os_unix.c @@ -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);