diff options
author | tamago324 <tamago_pad@yahoo.co.jp> | 2020-11-07 07:59:28 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-06 17:59:28 -0500 |
commit | 40a742725ccd472038685ccb99090ee2a6b2c912 (patch) | |
tree | 5535f53a5c1eec847bad0d956e332b7564e06820 /src/nvim/fileio.c | |
parent | d17e508796be60eefe4a597df62de1fd9e7e1725 (diff) | |
download | rneovim-40a742725ccd472038685ccb99090ee2a6b2c912.tar.gz rneovim-40a742725ccd472038685ccb99090ee2a6b2c912.tar.bz2 rneovim-40a742725ccd472038685ccb99090ee2a6b2c912.zip |
vim-patch:8.1.0268: file type checking has too many #ifdef (#13182)
Problem: File type checking has too many #ifdef.
Solution: Always define the S_IF macros. (Ken Takata, closes vim/vim#3306)
https://github.com/vim/vim/commit/d569bb029983cff947dce704e6f830276204c13f
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r-- | src/nvim/fileio.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index ad856b588a..e349f00fba 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -473,12 +473,8 @@ readfile( // On Unix it is possible to read a directory, so we have to // check for it before os_open(). if (perm >= 0 && !S_ISREG(perm) // not a regular file ... -# ifdef S_ISFIFO && !S_ISFIFO(perm) // ... or fifo -# endif -# ifdef S_ISSOCK && !S_ISSOCK(perm) // ... or socket -# endif # ifdef OPEN_CHR_FILES && !(S_ISCHR(perm) && is_dev_fd_file(fname)) // ... or a character special file named /dev/fd/<n> @@ -1840,25 +1836,14 @@ failed: c = false; #ifdef UNIX -# ifdef S_ISFIFO - if (S_ISFIFO(perm)) { /* fifo or socket */ - STRCAT(IObuff, _("[fifo/socket]")); - c = TRUE; - } -# else -# ifdef S_IFIFO - if ((perm & S_IFMT) == S_IFIFO) { /* fifo */ + if (S_ISFIFO(perm)) { // fifo STRCAT(IObuff, _("[fifo]")); c = TRUE; } -# endif -# ifdef S_IFSOCK - if ((perm & S_IFMT) == S_IFSOCK) { /* or socket */ + if (S_ISSOCK(perm)) { // or socket STRCAT(IObuff, _("[socket]")); c = TRUE; } -# endif -# endif # ifdef OPEN_CHR_FILES if (S_ISCHR(perm)) { /* or character special */ STRCAT(IObuff, _("[character special]")); |