diff options
Diffstat (limited to 'programs/util.h')
-rw-r--r-- | programs/util.h | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/programs/util.h b/programs/util.h index f1d8a92..4861049 100644 --- a/programs/util.h +++ b/programs/util.h @@ -198,7 +198,7 @@ UTIL_STATIC void* UTIL_realloc(void* ptr, size_t size) /* supports a==NULL or b==NULL */ UTIL_STATIC int UTIL_sameString(const char* a, const char* b) { - assert(a!=NULL && b!=NULL); /* unsupported scenario */ + assert(a != NULL || b != NULL); /* unsupported scenario */ if (a==NULL) return 0; if (b==NULL) return 0; return !strcmp(a,b); @@ -409,7 +409,6 @@ UTIL_STATIC int UTIL_getFileStat(const char* infilename, stat_t *statbuf) return 1; } - UTIL_STATIC int UTIL_isRegFD(int fd) { stat_t statbuf; @@ -420,14 +419,13 @@ UTIL_STATIC int UTIL_isRegFD(int fd) return UTIL_getFDStat(fd, &statbuf); /* Only need to know whether it is a regular file */ } - UTIL_STATIC int UTIL_isRegFile(const char* infilename) { stat_t statbuf; return UTIL_getFileStat(infilename, &statbuf); /* Only need to know whether it is a regular file */ } -UTIL_STATIC int UTIL_isDir(const char* infilename) +UTIL_STATIC int UTIL_isDirectory(const char* infilename) { stat_t statbuf; int r; @@ -443,21 +441,6 @@ UTIL_STATIC int UTIL_isDir(const char* infilename) } -UTIL_STATIC U32 UTIL_isDirectory(const char* infilename) -{ - int r; - stat_t statbuf; -#if defined(_MSC_VER) - r = _stat64(infilename, &statbuf); - if (!r && (statbuf.st_mode & _S_IFDIR)) return 1; -#else - r = stat(infilename, &statbuf); - if (!r && S_ISDIR(statbuf.st_mode)) return 1; -#endif - return 0; -} - - UTIL_STATIC U64 UTIL_getOpenFileSize(FILE* file) { int r; |