#include <h/mh.h>
#include <h/addrsbr.h>
#include <h/fmt_scan.h>
-#include <zotnet/tws/tws.h>
+#include <h/tws.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
+
#define NFMTS MAXARGS
extern char *formataddr (); /* hook for custom address formatting */
return NULL;
if (get_x400_comp (mbox, "/PN=", buffer, buffer_len)) {
- for (mbox = buffer; mbox = strchr(mbox, '.'); )
+ for (mbox = buffer; (mbox = strchr(mbox, '.')); )
*mbox++ = ' ';
return buffer;
}
if (fmt->f_type == FT_LS_ADDR)
goto unfriendly;
- if ((str = mn->m_pers) == NULL)
+ if ((str = mn->m_pers) == NULL) {
if ((str = mn->m_note)) {
strncpy (buffer, str, sizeof(buffer));
str = buffer;
break;
}
}
+ }
break;
case FT_LOCALDATE:
*cp++ = c;
while (len > wid) {
/* try to break at a comma; failing that, break at a
- * space, failing that, just split the line.
+ * space.
*/
lastb = 0; sp = lp + wid;
while (sp > lp && (c = *--sp) != ',') {
if (! lastb && isspace(c))
lastb = sp - 1;
}
- if (sp == lp)
- if (! (sp = lastb))
+ if (sp == lp) {
+ if (! (sp = lastb)) {
sp = lp + wid - 1;
+ while (*sp && *sp != ',' && !isspace(*sp))
+ sp++;
+ if (*sp != ',')
+ sp--;
+ }
+ }
len -= sp - lp + 1;
while (cp < ep && lp <= sp)
*cp++ = *lp++;
- *cp++ = '\n';
- for (i=indent; cp < ep && i > 0; i--)
- *cp++ = ' ';
while (isspace(*lp))
lp++, len--;
+ if (*lp) {
+ if (cp < ep)
+ *cp++ = '\n';
+ for (i=indent; cp < ep && i > 0; i--)
+ *cp++ = ' ';
+ }
}
PUTS (cp, lp);
}