From: Philipp Takacs <philipp@bureaucracy.de>
Date: Wed, 18 Mar 2020 18:53:44 +0000 (+0100)
Subject: set SEQMOD if clear_msg_flags change the flags
X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=53774c2aaf168871f5595392c7ffc5ce953f4cf2;p=mmh

set SEQMOD if clear_msg_flags change the flags

This fixes a bug in folder_addmsg. If the sequences file containes
the new msgnum, seq_save won't override this.
---

diff --git a/sbr/seq_msgstats.c b/sbr/seq_msgstats.c
index 7ffbde16..bfd7fb27 100644
--- a/sbr/seq_msgstats.c
+++ b/sbr/seq_msgstats.c
@@ -27,6 +27,8 @@ void
 clear_msg_flags(struct msgs *mp, int msgnum)
 {
 	assert_msg_range(mp, msgnum);
+	if (mp->msgstats[msgnum - mp->lowoff])
+		mp->msgflags |= SEQMOD;
 	mp->msgstats[msgnum - mp->lowoff] = 0;
 }
 
diff --git a/test/tests/rcv/test-rcvstore-nounseen b/test/tests/rcv/test-rcvstore-nounseen
new file mode 100755
index 00000000..b97f8edc
--- /dev/null
+++ b/test/tests/rcv/test-rcvstore-nounseen
@@ -0,0 +1,18 @@
+#!/bin/sh
+######################################################
+#
+# Test rcvstore
+#
+######################################################
+
+. "$MH_TEST_COMMON"
+
+# check -nounseen
+printf "u: %s\n" $(basename $(mhpath b)) >> $MH_TEST_DIR/Mail/inbox/.mh_sequences
+runandcheck "rcvstore -nounseen <$MH_TEST_DIR/Mail/inbox/1" <<!
+!
+runandcheck 'mark -sequence u -list' <<!
+u: 
+!
+runandcheck 'diff -u "`mhpath f`" "`mhpath l`"' <<!
+!