From a6a02cde61145bf92b1a46410105cc58958e2355 Mon Sep 17 00:00:00 2001 From: "Steffen \"Daode\" Nurpmeso" Date: Mon, 8 Oct 2012 15:13:08 +0200 Subject: [PATCH] Rename userarg_extract() to lextract().. And change *all* remaining occurrences of sextract() which take input from the user -- and thus may contain references to files and pipe commands -- to lextract(). This extends an entire series of commits, the last of which being (grabaddrs(): use userarg_extract().., 2012-10-08), and hopefully is the last one. --- collect.c | 6 +++--- extern.h | 2 +- head.c | 6 +++--- main.c | 11 ++++------- names.c | 2 +- sendout.c | 5 ++--- tty.c | 3 +-- 7 files changed, 15 insertions(+), 20 deletions(-) diff --git a/collect.c b/collect.c index bb12d7f6..2f546108 100644 --- a/collect.c +++ b/collect.c @@ -721,7 +721,7 @@ cont: * Add to the To list. */ while ((hp->h_to = checkaddrs(cat(hp->h_to, - sextract(&linebuf[2], GTO|GFULL)))) + lextract(&linebuf[2], GTO|GFULL)))) == NULL); break; case 's': @@ -748,14 +748,14 @@ cont: * Add to the CC list. */ hp->h_cc = checkaddrs(cat(hp->h_cc, - sextract(&linebuf[2], GCC|GFULL))); + lextract(&linebuf[2], GCC|GFULL))); break; case 'b': /* * Add stuff to blind carbon copies list. */ hp->h_bcc = checkaddrs(cat(hp->h_bcc, - sextract(&linebuf[2], GBCC|GFULL))); + lextract(&linebuf[2], GBCC|GFULL))); break; case 'd': strncpy(linebuf + 2, getdeadletter(), linesize - 2); diff --git a/extern.h b/extern.h index 0a8b784a..8fbab626 100644 --- a/extern.h +++ b/extern.h @@ -397,7 +397,7 @@ struct name *nalloc(char *str, enum gfield ntype); struct name *ndup(struct name *np, enum gfield ntype); struct name *extract(char *line, enum gfield ntype); struct name *sextract(char *line, enum gfield ntype); -struct name *userarg_extract(char *line, enum gfield ntype); +struct name *lextract(char *line, enum gfield ntype); char *detract(struct name *np, enum gfield ntype); struct name *outof(struct name *names, FILE *fo, struct header *hp); int is_fileaddr(char *name); diff --git a/head.c b/head.c index 9dcbdec0..3c17b386 100644 --- a/head.c +++ b/head.c @@ -294,15 +294,15 @@ extract_header(FILE *fp, struct header *hp) if ((value = thisfield(linebuf, "to")) != NULL) { seenfields++; hq->h_to = checkaddrs(cat(hq->h_to, - sextract(value, GTO|GFULL))); + lextract(value, GTO|GFULL))); } else if ((value = thisfield(linebuf, "cc")) != NULL) { seenfields++; hq->h_cc = checkaddrs(cat(hq->h_cc, - sextract(value, GCC|GFULL))); + lextract(value, GCC|GFULL))); } else if ((value = thisfield(linebuf, "bcc")) != NULL) { seenfields++; hq->h_bcc = checkaddrs(cat(hq->h_bcc, - sextract(value, GBCC|GFULL))); + lextract(value, GBCC|GFULL))); } else if ((value = thisfield(linebuf, "from")) != NULL) { seenfields++; hq->h_from = checkaddrs(cat(hq->h_from, diff --git a/main.c b/main.c index c631cfa7..2e1263be 100644 --- a/main.c +++ b/main.c @@ -207,14 +207,12 @@ main(int argc, char *argv[]) break; case 'b': /* Get Blind Carbon Copy Recipient list */ - bcc = checkaddrs(cat(bcc, - userarg_extract(optarg, GBCC|GFULL))); + bcc = checkaddrs(cat(bcc, lextract(optarg,GBCC|GFULL))); sendflag++; break; case 'c': /* Get Carbon Copy Recipient list */ - cc = checkaddrs(cat(cc, - userarg_extract(optarg, GCC|GFULL))); + cc = checkaddrs(cat(cc, lextract(optarg, GCC|GFULL))); sendflag++; break; case 'D': @@ -283,7 +281,7 @@ jIflag: case 'I': i = count(smopts); fromaddr = optarg; smopts = cat(smopts, nalloc("-r", 0)); - smopts = cat(smopts, userarg_extract(optarg, GFULL)); + smopts = cat(smopts, lextract(optarg, GFULL)); if (count(smopts) != i + 2) { fprintf(stderr, tr(271, "More than one address " @@ -354,8 +352,7 @@ usage: fprintf(stderr, tr(135, usagestr), } } else { for (i = optind; argv[i]; i++) - to = checkaddrs(cat(to, - userarg_extract(argv[i], GTO|GFULL))); + to = checkaddrs(cat(to, lextract(argv[i], GTO|GFULL))); } /* Check for inconsistent arguments */ diff --git a/names.c b/names.c index e113e352..2fd090ea 100644 --- a/names.c +++ b/names.c @@ -148,7 +148,7 @@ sextract(char *line, enum gfield ntype) } struct name * -userarg_extract(char *line, enum gfield ntype) +lextract(char *line, enum gfield ntype) { return (extract1(line, ntype, ",", 1)); } diff --git a/sendout.c b/sendout.c index 3c6fe6f8..01f23d55 100644 --- a/sendout.c +++ b/sendout.c @@ -955,10 +955,9 @@ mail1(struct header *hp, int printheaders, struct message *quote, } #endif if ((cp = value("autocc")) != NULL && *cp) - hp->h_cc = cat(hp->h_cc, checkaddrs(sextract(cp, GCC|GFULL))); + hp->h_cc = cat(hp->h_cc, checkaddrs(lextract(cp, GCC|GFULL))); if ((cp = value("autobcc")) != NULL && *cp) - hp->h_bcc = cat(hp->h_bcc, - checkaddrs(sextract(cp, GBCC|GFULL))); + hp->h_bcc = cat(hp->h_bcc, checkaddrs(lextract(cp,GBCC|GFULL))); /* * Collect user's mail from standard input. * Get the result as mtf. diff --git a/tty.c b/tty.c index d4a1f00a..5cc468a5 100644 --- a/tty.c +++ b/tty.c @@ -245,8 +245,7 @@ grabaddrs(const char *field, struct name *np, int comma, enum gfield gflags) TTYSET_CHECK(np); loop: - np = userarg_extract(rtty_internal(field, detract(np, comma)), - gflags); + np = lextract(rtty_internal(field, detract(np, comma)), gflags); for (nq = np; nq != NULL; nq = nq->n_flink) if (mime_name_invalid(nq, 1)) goto loop; -- 2.11.4.GIT