]> granicus.if.org Git - neomutt/commitdiff
mutt_str_startswith - maildir/mh.c
authorPietro Cerutti <gahr@gahr.ch>
Fri, 9 Nov 2018 15:11:54 +0000 (15:11 +0000)
committerRichard Russon <rich@flatcap.org>
Wed, 14 Nov 2018 15:10:31 +0000 (15:10 +0000)
maildir/mh.c

index d65d93aedb7aba9791df29f8bc3b4b24fa093fc5..dcbc7fbcbc75a041f739ab01f2527a3f79c8cdcb 100644 (file)
@@ -486,11 +486,9 @@ static void mh_update_sequences(struct Mailbox *m)
   {
     while ((buf = mutt_file_read_line(buf, &s, ofp, &l, 0)))
     {
-      if (mutt_str_strncmp(buf, seq_unseen, mutt_str_strlen(seq_unseen)) == 0)
-        continue;
-      if (mutt_str_strncmp(buf, seq_flagged, mutt_str_strlen(seq_flagged)) == 0)
-        continue;
-      if (mutt_str_strncmp(buf, seq_replied, mutt_str_strlen(seq_replied)) == 0)
+      if (mutt_str_startswith(buf, seq_unseen, CASE_MATCH) ||
+          mutt_str_startswith(buf, seq_flagged, CASE_MATCH) ||
+          mutt_str_startswith(buf, seq_replied, CASE_MATCH))
         continue;
 
       fprintf(nfp, "%s\n", buf);
@@ -1916,7 +1914,7 @@ void maildir_parse_flags(struct Email *e, const char *path)
   e->replied = false;
 
   char *p = strrchr(path, ':');
-  if (p && (mutt_str_strncmp(p + 1, "2,", 2) == 0))
+  if (p && mutt_str_startswith(p + 1, "2,", CASE_MATCH))
   {
     p += 3;