commit f40b2da6f45dc71940900e424e99feb027cffc3b
parent 4f69a8f35d71d480295fcf6c3cd0c977b3e2544d
Author: David Gričar <suckless@coppie.xyz>
Date: Thu, 19 Mar 2020 11:19:23 +0100
Make last_dir function more readable
Diffstat:
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/build-page.c b/build-page.c
@@ -222,10 +222,8 @@ last_dir(char *this)
if (*de->d_name == '.')
continue;
snprintf(newdir, sizeof(newdir), this ? "%2$s/%1$s" : "%s", de->d_name, this);
- if (!stat_isdir(newdir))
- continue;
-
- dir = 1;
+ if (stat_isdir(newdir))
+ dir = 1;
}
closedir(dp);