if ((p = strchr (t, '-')))
{
*p++ = '\0';
- if (mutt_atoi (t, first) < 0 || mutt_atoi (t, last) < 0)
+ if (mutt_atoi (t, first) < 0 || mutt_atoi (p, last) < 0)
return -1;
}
else
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);
out:
FREE (&buff);
safe_fclose (&fp);
- return 0;
+ return rc;
}
static inline mode_t mh_umask (CONTEXT* ctx)
for (i = 0; !r && i <= mhs.max; i++)
if (mhs_check (&mhs, i) & MH_SEQ_UNSEEN)
r = 1;
+ mhs_free_sequences (&mhs);
return r;
}
if (!h->received)
h->received = h->date_sent;
- if (h->content->length <= 0)
- h->content->length = st.st_size - h->content->offset;
+ /* always update the length since we have fresh information available. */
+ h->content->length = st.st_size - h->content->offset;
h->index = -1;
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);