Mercurial > vim
comparison src/if_cscope.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 | c62601adad69 |
children | 27b9a84395b5 |
comparison
equal
deleted
inserted
replaced
14508:7336a81d18c4 | 14509:80f715651c4c |
---|---|
548 if (ret < 0) | 548 if (ret < 0) |
549 goto staterr; | 549 goto staterr; |
550 } | 550 } |
551 | 551 |
552 /* if filename is a directory, append the cscope database name to it */ | 552 /* if filename is a directory, append the cscope database name to it */ |
553 if ((statbuf.st_mode & S_IFMT) == S_IFDIR) | 553 if (S_ISDIR(statbuf.st_mode)) |
554 { | 554 { |
555 fname2 = (char *)alloc((unsigned)(strlen(CSCOPE_DBFILE) + strlen(fname) + 2)); | 555 fname2 = (char *)alloc((unsigned)(strlen(CSCOPE_DBFILE) + strlen(fname) + 2)); |
556 if (fname2 == NULL) | 556 if (fname2 == NULL) |
557 goto add_err; | 557 goto add_err; |
558 | 558 |
579 goto add_err; | 579 goto add_err; |
580 } | 580 } |
581 | 581 |
582 i = cs_insert_filelist(fname2, ppath, flags, &statbuf); | 582 i = cs_insert_filelist(fname2, ppath, flags, &statbuf); |
583 } | 583 } |
584 #if defined(UNIX) | |
585 else if (S_ISREG(statbuf.st_mode) || S_ISLNK(statbuf.st_mode)) | 584 else if (S_ISREG(statbuf.st_mode) || S_ISLNK(statbuf.st_mode)) |
586 #else | |
587 /* WIN32 - substitute define S_ISREG from os_unix.h */ | |
588 else if (((statbuf.st_mode) & S_IFMT) == S_IFREG) | |
589 #endif | |
590 { | 585 { |
591 i = cs_insert_filelist(fname, ppath, flags, &statbuf); | 586 i = cs_insert_filelist(fname, ppath, flags, &statbuf); |
592 } | 587 } |
593 else | 588 else |
594 { | 589 { |