From: a bellenir Date: Thu, 24 Jul 2014 00:44:08 +0000 (+0000) Subject: shorten isdir X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=d74a0113e86826a657208237284c777190ca4b9e;p=archive%2Fafm.git shorten isdir --- 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);