]> git.mdlowis.com Git - archive/afm.git/commitdiff
shorten isdir
authora bellenir <a@bellenir.com>
Thu, 24 Jul 2014 00:44:08 +0000 (00:44 +0000)
committera bellenir <a@bellenir.com>
Thu, 24 Jul 2014 00:44:08 +0000 (00:44 +0000)
source/workdir.c

index 7977a512d035753560024a5f4d8fc38ce663711f..2dfde8119820bd4c65cfe6684a3fa461916a41f2 100644 (file)
@@ -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);