X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Ffmt_compile.c;h=798f1f6888d57a1bb1ee0b671c2444371f6217f0;hp=339ac0a21b51fb54f936de173f087068e1dffe0d;hb=fb49dd82ec42997b9df97f221c920f6596102c0a;hpb=1691e80890e5d8ba258c51c214a3e91880e1db2b diff --git a/sbr/fmt_compile.c b/sbr/fmt_compile.c index 339ac0a..798f1f6 100644 --- a/sbr/fmt_compile.c +++ b/sbr/fmt_compile.c @@ -3,14 +3,29 @@ * 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 #include -#include +#include #include #include +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else +# ifdef TM_IN_SYS_TIME +# include +# else +# include +# endif +#endif + /* * hash table for deciding if a component is "interesting" */ @@ -134,6 +149,8 @@ static struct ftable functable[] = { { "mymbox", TF_COMP, FT_LV_COMPFLAG, FT_MYMBOX, TFL_PUTN }, { "addtoseq", TF_STR, FT_ADDTOSEQ, 0, 0 }, + { "unquote", TF_EXPR, FT_LS_UNQUOTE, 0, TFL_PUTS}, + { NULL, 0, 0, 0, 0 } }; @@ -259,6 +276,7 @@ fmt_compile(char *fstring, struct format **fmt) * 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) @@ -407,13 +425,11 @@ do_name(char *sp, int preprocess) 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: @@ -421,18 +437,15 @@ do_name(char *sp, int preprocess) 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: