[wiki] [sites] Make last_dir function more readable || David Gričar

From: <git_AT_suckless.org>
Date: Thu, 19 Mar 2020 11:23:00 +0100

commit f40b2da6f45dc71940900e424e99feb027cffc3b
Author: David Gričar <suckless_AT_coppie.xyz>
Date: Thu Mar 19 11:19:23 2020 +0100

    Make last_dir function more readable

diff --git a/build-page.c b/build-page.c
index f07ef4a8..1eba1ca9 100644
--- a/build-page.c
+++ b/build-page.c
_AT_@ -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);
 
Received on Thu Mar 19 2020 - 11:23:00 CET

This archive was generated by hypermail 2.3.0 : Thu Mar 19 2020 - 11:24:48 CET