diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-01-13 17:08:31 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-01-13 17:08:31 +0000 |
commit | 345260e086c61c94336611049e0bb5157c46a927 (patch) | |
tree | 9fb742e5b85b8020c91d993c71fc3863e033721d | |
parent | 8839b46cd7cd1eddfb03a20449de2487bf77536a (diff) | |
download | fetchmail-345260e086c61c94336611049e0bb5157c46a927.tar.gz fetchmail-345260e086c61c94336611049e0bb5157c46a927.tar.bz2 fetchmail-345260e086c61c94336611049e0bb5157c46a927.zip |
Can't reproduce NAKANE's problem.
svn path=/trunk/; revision=751
-rw-r--r-- | rfc822.c | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -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); } } |