diff options
| author | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2003-11-15 11:08:26 +0000 |
|---|---|---|
| committer | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2003-11-15 11:08:26 +0000 |
| commit | db1c2da3344070dd8e34136a90134ee72d254b63 (patch) | |
| tree | 284150c8e2b4fb896c13bc9455d0d87b5856eb0b /libexec/ftpd | |
| parent | 4d450ff944c15ab852ee899b7144bf45bb6ef555 (diff) | |
Notes
Diffstat (limited to 'libexec/ftpd')
| -rw-r--r-- | libexec/ftpd/ftpd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index bcb7bef01671..40741f055bd6 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1970,7 +1970,7 @@ pdata_err: static int send_data(FILE *instr, FILE *outstr, off_t blksize, off_t filesize, int isreg) { - int c, filefd, netfd; + int c, cp, filefd, netfd; char *buf; off_t cnt; @@ -1978,16 +1978,18 @@ send_data(FILE *instr, FILE *outstr, off_t blksize, off_t filesize, int isreg) switch (type) { case TYPE_A: + cp = '\0'; while ((c = getc(instr)) != EOF) { if (recvurg) goto got_oob; byte_count++; - if (c == '\n') { + if (c == '\n' && cp != '\r') { if (ferror(outstr)) goto data_err; (void) putc('\r', outstr); } (void) putc(c, outstr); + cp = c; } if (recvurg) goto got_oob; |
