-int is_a_leading_from_line(char *s) {
- return strncmp(s, "From ", 5) == 0 &&
- regexec(&leading_from_line_regexp, s, 0, 0, 0) == 0;
+int is_a_leading_from_line(int last_mbox_line_was_empty, char *mbox_line) {
+ return
+
+ /*
+
+ The mbox man page in qmail documentation states:
+
+ > The reader should not attempt to take advantage of the fact
+ > that every From_ line (past the beginning of the file) is
+ > preceded by a blank line.
+
+ */
+
+ /* last_mbox_line_was_empty && */
+ strncmp(mbox_line, "From ", 5) == 0 &&
+ regexec(&leading_from_line_regexp, mbox_line, 0, 0, 0) == 0;