- fmt_top = fmt;
-#endif /* JLR */
- FINDCOMP(bodycomp, "body");
- FINDCOMP(datecomp, "date");
- FINDCOMP(cptr, "folder");
- if (cptr && folder)
- cptr->c_text = folder;
- FINDCOMP(cptr, "encrypted");
- if (!cptr)
- if ((cptr = (struct comp *) calloc (1, sizeof(*cptr)))) {
- cptr->c_name = "encrypted";
- cptr->c_next = wantcomp[i = CHASH (cptr->c_name)];
- wantcomp[i] = cptr;
- ncomps++;
- }
- FINDCOMP (cptr, "dtimenow");
- if (cptr)
- cptr->c_text = getcpy(dtimenow (0));
- nxtbuf = compbuffers = (char **) calloc((size_t) ncomps, sizeof(char *));
- if (nxtbuf == NULL)
- adios (NULL, "unable to allocate component buffers");
- used_buf = (struct comp **) calloc((size_t) (ncomps+1),
- sizeof(struct comp *));
- if (used_buf == NULL)
- adios (NULL, "unable to allocate component buffer stack");
- used_buf += ncomps+1; *--used_buf = 0;
- rlwidth = bodycomp && (width > SBUFSIZ) ? width : SBUFSIZ;
- for (i = ncomps; i--; )
- if ((*nxtbuf++ = malloc(rlwidth)) == NULL)
- adios (NULL, "unable to allocate component buffer");
- }
-
- /*
- * each-message initialization
- */
- nxtbuf = compbuffers;
- savecomp = used_buf;
- tmpbuf = *nxtbuf++;
- dat[0] = innum ? innum : outnum;
- dat[1] = curflg;
- dat[4] = unseen;
-
- /*
- * Get the first field. If the message is non-empty
- * and we're doing an "inc", open the output file.
- */
- if ((state = m_getfld (FLD, name, tmpbuf, rlwidth, inb)) == FILEEOF) {
- if (ferror(inb)) {
- advise("read", "unable to"); /* "read error" */
- return SCNFAT;
- } else {
- return SCNEOF;
- }
- }
-
- if (outnum) {
- if (outnum > 0) {
- scnmsg = m_name (outnum);
- if (*scnmsg == '?') /* msg num out of range */
- return SCNNUM;
- } else {
- scnmsg = "/dev/null";
+ fmt_top = fmt;
+#endif /* JLR */
+ FINDCOMP(bodycomp, "body");
+ FINDCOMP(datecomp, "date");
+ FINDCOMP(cptr, "folder");
+ if (cptr && folder)
+ cptr->c_text = folder;
+ FINDCOMP(cptr, "encrypted");
+ if (!cptr)
+ if ((cptr = (struct comp *)calloc(1, sizeof(*cptr)))) {
+ cptr->c_name = "encrypted";
+ cptr->c_next = wantcomp[i = CHASH(cptr->c_name)];
+ wantcomp[i] = cptr;
+ ncomps++;
+ }
+ FINDCOMP(cptr, "dtimenow");
+ if (cptr)
+ cptr->c_text = getcpy(dtimenow(0));
+ nxtbuf = compbuffers = (char **) calloc((size_t) ncomps,
+ sizeof(char *));
+ if (nxtbuf == NULL)
+ adios(NULL, "unable to allocate component buffers");
+ used_buf = (struct comp **) calloc((size_t) (ncomps+1),
+ sizeof(struct comp *));
+ if (used_buf == NULL)
+ adios(NULL, "unable to allocate component buffer stack");
+ used_buf += ncomps+1; *--used_buf = 0;
+ rlwidth = bodycomp && (width > SBUFSIZ) ? width : SBUFSIZ;
+ for (i = ncomps; i--; )
+ *nxtbuf++ = mh_xmalloc(rlwidth);