X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fpicksbr.c;h=a7276d78febe3b352327bad7730caf7d62d04083;hb=b8ca332a9752c9de52613a229d95eb7c4c15ac20;hp=88463edebf9b0fddf3e1838c687a0a5ee914828d;hpb=1691e80890e5d8ba258c51c214a3e91880e1db2b;p=mmh diff --git a/uip/picksbr.c b/uip/picksbr.c index 88463ed..a7276d7 100644 --- a/uip/picksbr.c +++ b/uip/picksbr.c @@ -3,11 +3,27 @@ * picksbr.c -- routines to help pick along... * * $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 -#include +#include #include +#include + +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else +# ifdef TM_IN_SYS_TIME +# include +# else +# include +# endif +#endif static struct swit parswit[] = { #define PRAND 0 @@ -641,14 +657,15 @@ plist ebp = ibuf + strlen (ibuf); } c = *p2++; - if (lf && c != '\n') + if (lf && c != '\n') { if (c != ' ' && c != '\t') { --p2; break; } else lf = 0; - if (c == '\n') + } + if (c == '\n') { if (body) break; else { @@ -659,6 +676,7 @@ plist lf++; c = ' '; } + } if (c && p1 < &linebuf[LBSIZE - 1]) *p1++ = c; } @@ -677,7 +695,7 @@ plist if (*p2 == CCHR) { c = p2[1]; do { - if (*p1 == c || cc[*p1] == c) + if (*p1 == c || cc[(unsigned char)*p1] == c) if (advance (p1, p2)) return 1; } while (*p1++); @@ -702,7 +720,7 @@ advance (char *alp, char *aep) for (;;) switch (*ep++) { case CCHR: - if (*ep++ == *lp++ || ep[-1] == cc[lp[-1]]) + if (*ep++ == *lp++ || ep[-1] == cc[(unsigned char)lp[-1]]) continue; return 0; @@ -741,7 +759,7 @@ advance (char *alp, char *aep) case CCHR | STAR: curlp = lp; - while (*lp++ == *ep || cc[lp[-1]] == *ep) + while (*lp++ == *ep || cc[(unsigned char)lp[-1]] == *ep) continue; ep++; goto star; @@ -851,19 +869,19 @@ tws_special (char *ap) register struct tws *tw; time (&clock); - if (!strcasecmp (ap, "today")) + if (!mh_strcasecmp (ap, "today")) return dlocaltime (&clock); - if (!strcasecmp (ap, "yesterday")) { + if (!mh_strcasecmp (ap, "yesterday")) { clock -= (long) (60 * 60 * 24); return dlocaltime (&clock); } - if (!strcasecmp (ap, "tomorrow")) { + if (!mh_strcasecmp (ap, "tomorrow")) { clock += (long) (60 * 60 * 24); return dlocaltime (&clock); } for (i = 0; tw_ldotw[i]; i++) - if (!strcasecmp (ap, tw_ldotw[i])) + if (!mh_strcasecmp (ap, tw_ldotw[i])) break; if (tw_ldotw[i]) { if ((tw = dlocaltime (&clock)) == NULL) @@ -904,7 +922,7 @@ plist state = m_getfld (state, name, buf, sizeof buf, fp); bp = add (buf, bp); } - if (!strcasecmp (name, n->n_datef)) + if (!mh_strcasecmp (name, n->n_datef)) break; if (state != FLDEOF) continue;