diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2002-09-09 13:43:55 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2002-09-09 13:43:55 +0000 |
commit | 91341f7be66f2865fe4000dae05dd78f448b3ca6 (patch) | |
tree | 23ca050519a599578303e560be32a2a2d1ff8638 /sink.c | |
parent | dc688e8c7f7165d0019a56c0079df651d704664b (diff) | |
download | fetchmail-91341f7be66f2865fe4000dae05dd78f448b3ca6.tar.gz fetchmail-91341f7be66f2865fe4000dae05dd78f448b3ca6.tar.bz2 fetchmail-91341f7be66f2865fe4000dae05dd78f448b3ca6.zip |
Sunil Shetye's latest fix patch.
svn path=/trunk/; revision=3707
Diffstat (limited to 'sink.c')
-rw-r--r-- | sink.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -694,6 +694,7 @@ static const char *is_quad(const char *q) return NULL; /* Make sure quad is < 255 */ if ( (r-q) == 3) + { if (*q > '2') return NULL; else if (*q == '2') @@ -706,6 +707,7 @@ static const char *is_quad(const char *q) return NULL; } } + } return r; } @@ -1206,7 +1208,13 @@ void release_sink(struct query *ctl) /* release the per-message output sink, whether it's a pipe or SMTP socket */ { if (ctl->bsmtp && sinkfp) - fclose(sinkfp); + { + if (strcmp(ctl->bsmtp, "-")) + { + fclose(sinkfp); + sinkfp = (FILE *)NULL; + } + } else if (ctl->mda) { if (sinkfp) @@ -1251,7 +1259,10 @@ int close_sink(struct query *ctl, struct msgblk *msg, flag forward) fputs(".\r\n", sinkfp); error = ferror(sinkfp); if (strcmp(ctl->bsmtp, "-")) + { if (fclose(sinkfp) == EOF) error = 1; + sinkfp = (FILE *)NULL; + } if (error) { report(stderr, |