From 7b28c721b73652f36f95e2f402a594aca4e2dd15 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Fri, 25 Dec 2009 11:13:55 +0100 Subject: [PATCH] filecount plugin: Use the ?:-operator for the hidden argument. --- src/filecount.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/filecount.c b/src/filecount.c index 9f6ea564..47f99e91 100644 --- a/src/filecount.c +++ b/src/filecount.c @@ -478,10 +478,8 @@ static int fc_read_dir_callback (const char *dirname, const char *filename, if (S_ISDIR (statbuf.st_mode) && (dir->options & FC_RECURSIVE)) { - if(dir->options & FC_HIDDEN) - status = walk_directory (abs_path, fc_read_dir_callback, dir,/* include hidden */1); - else - status = walk_directory (abs_path, fc_read_dir_callback, dir,/* include hidden */ 0); + status = walk_directory (abs_path, fc_read_dir_callback, dir, + /* include hidden = */ (dir->options & FC_HIDDEN) ? 1 : 0); return (status); } else if (!S_ISREG (statbuf.st_mode)) @@ -544,10 +542,8 @@ static int fc_read_dir (fc_directory_conf_t *dir) if (dir->mtime != 0) dir->now = time (NULL); - if(dir->options & FC_HIDDEN) - status = walk_directory (dir->path, fc_read_dir_callback, dir,/* include hidden */ 1); - else - status = walk_directory (dir->path, fc_read_dir_callback, dir,/* include hidden */ 0); + status = walk_directory (dir->path, fc_read_dir_callback, dir, + /* include hidden */ (dir->options & FC_HIDDEN) ? 1 : 0); if (status != 0) { WARNING ("filecount plugin: walk_directory (%s) failed.", dir->path); -- 2.30.2