From: Kees Cook Date: Tue, 28 Jul 2009 04:14:29 +0000 (-0700) Subject: Properly propagate mh_read_sequences result. Closes #3308. X-Git-Tag: neomutt-20160307~466 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c5f3ddc331f24f1f47080c2468187d30ef04c2a6;p=neomutt Properly propagate mh_read_sequences result. Closes #3308. --- diff --git a/mh.c b/mh.c index e46819cde..b03e71465 100644 --- a/mh.c +++ b/mh.c @@ -167,7 +167,7 @@ static int mh_read_sequences (struct mh_sequences *mhs, const char *path) size_t sz = 0; short f; - int first, last, rc; + int first, last, rc = 0; char pathname[_POSIX_PATH_MAX]; snprintf (pathname, sizeof (pathname), "%s/.mh_sequences", path); @@ -207,7 +207,7 @@ static int mh_read_sequences (struct mh_sequences *mhs, const char *path) out: FREE (&buff); safe_fclose (&fp); - return 0; + return rc; } static inline mode_t mh_umask (CONTEXT* ctx) @@ -1156,7 +1156,7 @@ int mh_read_dir (CONTEXT * ctx, const char *subdir) if (ctx->magic == M_MH) { - if (mh_read_sequences (&mhs, ctx->path) >= 0) + if (mh_read_sequences (&mhs, ctx->path) < 0) return -1; mh_update_maildir (md, &mhs); mhs_free_sequences (&mhs);