enum state state = FLD2;
FILE *file = fopen(path, "r");
- while (state == FLD2 && !msgid && !referens) {
+ while (state == FLD2 && !(msgid && referens)) {
switch (state = m_getfld2(state, &f, file)) {
case FLD2:
if (strncasecmp("message-id", f.name, f.namelen)==0) {
msgid = f.value;
f.value = NULL;
+ f.alloclen = 0;
} else if (strncasecmp("references", f.name, f.namelen)==0) {
referens = f.value;
f.value = NULL;
+ f.alloclen = 0;
}
break;
default:
#
######################################################
-expected_err=$MH_TEST_DIR/$$.expected_err
-expected_out=$MH_TEST_DIR/$$.expected_out
-actual_err=$MH_TEST_DIR/$$.actual_err
-actual_out=$MH_TEST_DIR/$$.actual_out
+. "$MH_TEST_COMMON"
# All messages should be go to stdout
-cp `mhpath 5` 5.old
anno -component 'Message-Id' -text '<testid>' 5 -nodate
-cat > $expected_out <<EOF
+anno -component 'Message-Id' -text '<testid2>' 6 -nodate
+
+runandcheck 'pick -thread 5' <<!
5
-EOF
-# Nothing should to go stderr
-cat /dev/null > $expected_err
+!
-pick -thread 5 > $actual_out 2> $actual_err
-mv 5.old `mhpath 5`
-diff -u $expected_err $actual_err
-diff -u $expected_out $actual_out
+anno -component 'References' -text '<testid>' 6 -nodate -append
+runandcheck 'pick -thread 5' <<!
+5
+6
+!
+runandcheck 'pick -thread 6' <<!
+5
+6
+!
+anno -delete -component 'References'
+anno -component 'References' -text '<testid>' 6 -nodate
+runandcheck 'pick -thread 6' <<!
+5
+6
+!