From 345260e086c61c94336611049e0bb5157c46a927 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 13 Jan 1997 17:08:31 +0000 Subject: Can't reproduce NAKANE's problem. svn path=/trunk/; revision=751 --- rfc822.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/rfc822.c b/rfc822.c index d4342afb..31bf0c67 100644 --- a/rfc822.c +++ b/rfc822.c @@ -35,6 +35,10 @@ const char *host; /* server hostname */ strcpy(mycopy, buf); for (from = mycopy; *from; from++) { +#ifdef FOO + printf("state %d: %s", state, mycopy); + printf("%*s^\n", from - mycopy + 10, " "); +#endif /* TESTMAIN */ switch (state) { case 0: /* before header colon */ @@ -328,6 +332,7 @@ const char *hdr; /* header to be parsed, NUL to continue previous hdr */ main(int argc, char *argv[]) { char buf[POPBUFSIZE], *cp; + int reply = (argc > 1 && !strcmp(argv[1], "-r")); while (fgets(buf, sizeof(buf)-1, stdin)) { @@ -340,11 +345,17 @@ main(int argc, char *argv[]) else { fputs(buf, stdout); - if ((cp = nxtaddr(buf)) != (char *)NULL) - do { - printf("\t%s\n", cp); - } while - ((cp = nxtaddr((char *)NULL)) != (char *)NULL); + if (reply) + { + reply_hack(buf, "HOSTNAME.NET"); + printf("Rewritten buffer: %s", buf); + } + else + if ((cp = nxtaddr(buf)) != (char *)NULL) + do { + printf("\t%s\n", cp); + } while + ((cp = nxtaddr((char *)NULL)) != (char *)NULL); } } -- cgit v1.2.3