1 this fixes a problem with new mail detection on MH folder, for a
2 more detailed history see mutt bugs #3308 and #3312 and debian
11 -static int mh_read_token (char *t, int *first, int *last)
12 +static void mh_read_token (char *t, int *first, int *last)
15 if ((p = strchr (t, '-')))
18 - if (mutt_atoi (t, first) < 0 || mutt_atoi (t, last) < 0)
25 - if (mutt_atoi (t, first) < 0)
30 + *first = *last = atoi (t);
33 static int mh_read_sequences (struct mh_sequences *mhs, const char *path)
38 - int first, last, rc;
39 + int first, last, rc = 0;
41 char pathname[_POSIX_PATH_MAX];
42 snprintf (pathname, sizeof (pathname), "%s/.mh_sequences", path);
45 while ((t = strtok (NULL, " \t:")))
47 - if (mh_read_token (t, &first, &last) < 0)
49 - mhs_free_sequences (mhs);
53 + mh_read_token (t, &first, &last);
54 for (; first <= last; first++)
55 mhs_set (mhs, first, f);
65 static inline mode_t mh_umask (CONTEXT* ctx)
68 if (ctx->magic == M_MH)
70 - if (mh_read_sequences (&mhs, ctx->path) >= 0)
71 + if (mh_read_sequences (&mhs, ctx->path) < 0)
73 mh_update_maildir (md, &mhs);
74 mhs_free_sequences (&mhs);