summaryrefslogtreecommitdiffstats
path: root/src/if_cscope.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-08-11 13:57:20 +0200
committerBram Moolenaar <Bram@vim.org>2018-08-11 13:57:20 +0200
commitd569bb029983cff947dce704e6f830276204c13f (patch)
tree50736305a13af688a8321d0b4688042f61526362 /src/if_cscope.c
parent90f1e2b7bcf56112e1535b693acf131727179a6e (diff)
patch 8.1.0268: file type checking has too many #ifdefv8.1.0268
Problem: File type checking has too many #ifdef. Solution: Always define the S_IF macros. (Ken Takata, closes #3306)
Diffstat (limited to 'src/if_cscope.c')
-rw-r--r--src/if_cscope.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/if_cscope.c b/src/if_cscope.c
index d621a146b3..186179ca05 100644
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -550,7 +550,7 @@ staterr:
}
/* if filename is a directory, append the cscope database name to it */
- if ((statbuf.st_mode & S_IFMT) == S_IFDIR)
+ if (S_ISDIR(statbuf.st_mode))
{
fname2 = (char *)alloc((unsigned)(strlen(CSCOPE_DBFILE) + strlen(fname) + 2));
if (fname2 == NULL)
@@ -581,12 +581,7 @@ staterr:
i = cs_insert_filelist(fname2, ppath, flags, &statbuf);
}
-#if defined(UNIX)
else if (S_ISREG(statbuf.st_mode) || S_ISLNK(statbuf.st_mode))
-#else
- /* WIN32 - substitute define S_ISREG from os_unix.h */
- else if (((statbuf.st_mode) & S_IFMT) == S_IFREG)
-#endif
{
i = cs_insert_filelist(fname, ppath, flags, &statbuf);
}