set SEQMOD if clear_msg_flags change the flags
authorPhilipp Takacs <philipp@bureaucracy.de>
Wed, 18 Mar 2020 18:53:44 +0000 (19:53 +0100)
committerPhilipp Takacs <philipp@bureaucracy.de>
Sun, 29 Mar 2020 19:23:55 +0000 (21:23 +0200)
This fixes a bug in folder_addmsg. If the sequences file containes
the new msgnum, seq_save won't override this.

sbr/seq_msgstats.c
test/tests/rcv/test-rcvstore-nounseen [new file with mode: 0755]

index 7ffbde1..bfd7fb2 100644 (file)
@@ -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 (executable)
index 0000000..b97f8ed
--- /dev/null
@@ -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`"' <<!
+!