]> diplodocus.org Git - nmh/blobdiff - sbr/m_getfld.c
Updates for 1.7 release.
[nmh] / sbr / m_getfld.c
index cc283c2a9248eb27a17a4f81186101ddd67e92a4..d74f3869a3fc2f079d218e69a08a0c83bbc45450 100644 (file)
@@ -205,6 +205,14 @@ static int m_Eom (m_getfld_state_t);
 #define eom(c,s)       (s->msg_style != MS_DEFAULT && \
                         ((c) == *s->msg_delim && m_Eom(s)))
 
+/*
+ * Maildrop styles
+ */
+#define        MS_DEFAULT      0       /* default (one msg per file) */
+#define        MS_UNKNOWN      1       /* type not known yet         */
+#define        MS_MBOX         2       /* Unix-style "from" lines    */
+#define        MS_MMDF         3       /* string MMDF_DELIM          */
+
 /* This replaces the old approach, with its direct access to stdio
  * internals.  It uses one fread() to load a buffer that we manage.
  *
@@ -895,10 +903,11 @@ m_Eom (m_getfld_state_t s)
            return 1;
        }
 
-       if (i != s->edelimlen  &&  ! strncmp(text, s->fdelim, i)) {
-            /* If all or part of fdelim appeared at the end of the file,
-               back up even more so that the bytes are included in the
-               message. */
+       if (i <= 2  &&  s->msg_style == MS_MBOX  &&
+           i != s->edelimlen  &&  ! strncmp(text, s->fdelim, i)) {
+           /* If all or part of fdelim appeared at the end of the file,
+              back up even more so that the bytes are included in the
+              message. */
            adjust = 2;
        }