* fmt_compile.c -- "compile" format strings for fmt_scan
*
* $Id$
+ *
+ * This code is Copyright (c) 2002, by the authors of nmh. See the
+ * COPYRIGHT file in the root directory of the nmh distribution for
+ * complete copyright information.
*/
#include <h/mh.h>
#include <h/addrsbr.h>
-#include <zotnet/tws/tws.h>
+#include <h/tws.h>
#include <h/fmt_scan.h>
#include <h/fmt_compile.h>
+#ifdef TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# ifdef TM_IN_SYS_TIME
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
/*
* hash table for deciding if a component is "interesting"
*/
* normal processing.
*/
i = strlen(fstring)/2 + 1;
+ if (i==1) i++;
next_fp = formatvec = (struct format *)calloc ((size_t) i,
sizeof(struct format));
if (next_fp == NULL)
if (cm->c_type & CT_ADDR) {
CERROR("component used as both date and address");
}
- if (! (cm->c_type & CT_DATE)) {
- cm->c_tws = (struct tws *)
- calloc((size_t) 1, sizeof(*cm->c_tws));
- fp->f_type = preprocess;
- PUTCOMP(sp);
- cm->c_type |= CT_DATE;
- }
+ cm->c_tws = (struct tws *)
+ calloc((size_t) 1, sizeof(*cm->c_tws));
+ fp->f_type = preprocess;
+ PUTCOMP(sp);
+ cm->c_type |= CT_DATE;
break;
case FT_MYMBOX:
ismymbox ((struct mailname *) 0);
primed++;
}
- cm->c_type |= CT_MYMBOX;
/* fall through */
case FT_PARSEADDR:
if (cm->c_type & CT_DATE) {
CERROR("component used as both date and address");
}
- if (! (cm->c_type & CT_ADDRPARSE)) {
- cm->c_mn = &fmt_mnull;
- fp->f_type = preprocess;
- PUTCOMP(sp);
- cm->c_type |= (CT_ADDR | CT_ADDRPARSE);
- }
+ cm->c_mn = &fmt_mnull;
+ fp->f_type = preprocess;
+ PUTCOMP(sp);
+ cm->c_type |= CT_ADDR;
break;
case FT_FORMATADDR: