X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fmhlsbr.c;h=be63c25baf18cff3a004fa1793ee564715db40fb;hb=3bebe0e894828d80183926d4fc19fc01cd3c274e;hp=d49314f479da8b8693b18527bb9fd791bcb8fd9b;hpb=a1e2db74e04c31153801efabcc31b6f68587eeb4;p=mmh diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index d49314f..be63c25 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -223,6 +223,22 @@ static struct triple triples[] = { { NULL, 0, 0 } }; +static char *addrcomps[] = { + "from", + "sender", + "reply-to", + "to", + "cc", + "bcc", + "resent-from", + "resent-sender", + "resent-reply-to", + "resent-to", + "resent-cc", + "resent-bcc", + NULL +}; + static int bellflg = 0; static int clearflg = 0; @@ -852,7 +868,7 @@ process (char *folder, char *fname, int ofilen, int ofilec) struct mcomp *c1; struct stat st; - switch (m_setjmp (env)) { + switch (setjmp (env)) { case OK: if (fname) { fp = mhl_action ? (*mhl_action) (fname) : fopen (fname, "r"); @@ -1756,7 +1772,7 @@ mhlsbr (int argc, char **argv, FILE *(*action)()) char *cp = NULL; struct mcomp *c1; - switch (m_setjmp (mhlenv)) { + switch (setjmp (mhlenv)) { case OK: cp = invo_name; sleepsw = 0; /* XXX */ @@ -1907,10 +1923,22 @@ compileargs (struct mcomp *c1, char *nfs) { struct format *fmt; struct arglist *args; + char **ap; + struct comp *cptr; unsigned int i; i = fmt_compile(nfs, &fmt); + /* + * Search through and mark any components that are address components + */ + + for (ap = addrcomps; *ap; ap++) { + FINDCOMP (cptr, *ap); + if (cptr) + cptr->c_type |= CT_ADDR; + } + args = (struct arglist *) mh_xmalloc(sizeof(struct arglist)); if (! args) @@ -1971,9 +1999,7 @@ checkcomp(char *name, char *buf) if (mh_strcasecmp(name, c->c_name) == 0) { found++; if (! c->c_text) { - i = strlen(c->c_text = strdup(buf)) - 1; - if (c->c_text[i] == '\n') - c->c_text[i] = '\0'; + c->c_text = strdup(buf); } else { i = strlen(cp = c->c_text) - 1; if (cp[i] == '\n') {