cvs: php4 /ext/ftp ftp.c

From: Date: Thu, 10 Aug 2000 21:13:09 +0000
Subject: cvs: php4 /ext/ftp ftp.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-1135@lists.php.net to get a copy of this message
sniper Thu Aug 10 14:13:09 2000 EDT Modified files: /php4/ext/ftp ftp.c Log: @- Fixed FTP module to accept multiline server replies (Jani) # This fixed bug #4546. Index: php4/ext/ftp/ftp.c diff -u php4/ext/ftp/ftp.c:1.23 php4/ext/ftp/ftp.c:1.24 --- php4/ext/ftp/ftp.c:1.23 Sat Jun 17 09:49:03 2000 +++ php4/ext/ftp/ftp.c Thu Aug 10 14:13:08 2000 @@ -28,7 +28,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: ftp.c,v 1.23 2000/06/17 16:49:03 zeev Exp $ */ +/* $Id: ftp.c,v 1.24 2000/08/10 21:13:08 sniper Exp $ */ #include "php.h" @@ -790,26 +790,29 @@ int ftp_getresp(ftpbuf_t *ftp) { - char *buf; + char *buf; - if (ftp == NULL) - return 0; + if (ftp == NULL) return 0; buf = ftp->inbuf; ftp->resp = 0; - while (1) { - if (!ftp_readline(ftp)) - return 0; - if (ftp->inbuf[3] == '-') - continue; - else if (ftp->inbuf[3] != ' ') + + if (!ftp_readline(ftp)) { return 0; - break; + } + + /* Break out when the end-tag is found */ + if (isdigit(ftp->inbuf[0]) && + isdigit(ftp->inbuf[1]) && + isdigit(ftp->inbuf[2]) && + ftp->inbuf[3] == ' ') { + break; + } } /* translate the tag */ - if ( !isdigit(ftp->inbuf[0]) || + if (!isdigit(ftp->inbuf[0]) || !isdigit(ftp->inbuf[1]) || !isdigit(ftp->inbuf[2])) {

« previous php.cvs (#1135) next »