summaryrefslogtreecommitdiffstats
path: root/builtin/mailsplit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-05-21 00:26:59 +0200
committerJunio C Hamano <gitster@pobox.com>2022-05-21 00:26:59 +0200
commit538dc459a0331c48b893c9f6ca0be5917860bb99 (patch)
treed8b7cf10c62573f767116c14f7ffd0d9e1d8ec32 /builtin/mailsplit.c
parentMerge branch 'ds/sparse-colon-path' (diff)
parenttree-wide: apply equals-null.cocci (diff)
downloadgit-538dc459a0331c48b893c9f6ca0be5917860bb99.tar.xz
git-538dc459a0331c48b893c9f6ca0be5917860bb99.zip
Merge branch 'ep/maint-equals-null-cocci'
Introduce and apply coccinelle rule to discourage an explicit comparison between a pointer and NULL, and applies the clean-up to the maintenance track. * ep/maint-equals-null-cocci: tree-wide: apply equals-null.cocci tree-wide: apply equals-null.cocci contrib/coccinnelle: add equals-null.cocci
Diffstat (limited to 'builtin/mailsplit.c')
-rw-r--r--builtin/mailsplit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c
index 30952353a3..73509f651b 100644
--- a/builtin/mailsplit.c
+++ b/builtin/mailsplit.c
@@ -120,7 +120,7 @@ static int populate_maildir_list(struct string_list *list, const char *path)
for (sub = subs; *sub; ++sub) {
free(name);
name = xstrfmt("%s/%s", path, *sub);
- if ((dir = opendir(name)) == NULL) {
+ if (!(dir = opendir(name))) {
if (errno == ENOENT)
continue;
error_errno("cannot opendir %s", name);