From d74a0113e86826a657208237284c777190ca4b9e Mon Sep 17 00:00:00 2001 From: a bellenir Date: Thu, 24 Jul 2014 00:44:08 +0000 Subject: [PATCH] shorten isdir --- source/workdir.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/source/workdir.c b/source/workdir.c index 7977a51..2dfde81 100644 --- a/source/workdir.c +++ b/source/workdir.c @@ -15,11 +15,7 @@ static void get_files(int windex); static bool is_dir(char* path) { struct stat s; - if( stat(path, &s) == 0){ - return (s.st_mode & S_IFDIR); - }/*else error*/ - return false; - //TODO: oneliner: return ((stat(path, &s) == 0) && (s.st_mode & S_IFDIR)); + return ((stat(path, &s) == 0) && (s.st_mode & S_IFDIR)); } void workdir_free(void* p_wd); -- 2.55.0