summaryrefslogtreecommitdiff
path: root/lib/libfetch/ftp.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2000-06-28 15:48:26 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2000-06-28 15:48:26 +0000
commiteac7a1e07f603ccf07d224b5d24b4031cb96dd76 (patch)
tree2d29ab9cb321da69bd30bdc0d195f9e14379ea59 /lib/libfetch/ftp.c
parent231b1f331e265407e9e185cb3f6390d666bdc321 (diff)
Notes
Diffstat (limited to 'lib/libfetch/ftp.c')
-rw-r--r--lib/libfetch/ftp.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index a8a414693856..c9aec194fe75 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -134,15 +134,24 @@ unmappedaddr(struct sockaddr_in6 *sin6)
static int
_ftp_chkerr(int cd)
{
- do {
- if (_fetch_getln(cd, &last_reply, &lr_size, &lr_length) == -1) {
- _fetch_syserr();
- return -1;
- }
+ if (_fetch_getln(cd, &last_reply, &lr_size, &lr_length) == -1) {
+ _fetch_syserr();
+ return -1;
+ }
#ifndef NDEBUG
- _fetch_info("got reply '%.*s'", lr_length - 2, last_reply);
+ _fetch_info("got reply '%.*s'", lr_length - 2, last_reply);
#endif
- } while (isftpinfo(last_reply));
+ if (isftpinfo(last_reply)) {
+ while (!isftpreply(last_reply)) {
+ if (_fetch_getln(cd, &last_reply, &lr_size, &lr_length) == -1) {
+ _fetch_syserr();
+ return -1;
+ }
+#ifndef NDEBUG
+ _fetch_info("got reply '%.*s'", lr_length - 2, last_reply);
+#endif
+ }
+ }
while (lr_length && isspace(last_reply[lr_length-1]))
lr_length--;