sesser          Thu Oct  3 08:16:45 2002 EDT

  Modified files:              
    /php4/ext/ftp       ftp.c ftp.h 
  Log:
  swapped conditions to correct the logic
  
  
  
  
Index: php4/ext/ftp/ftp.c
diff -u php4/ext/ftp/ftp.c:1.65 php4/ext/ftp/ftp.c:1.66
--- php4/ext/ftp/ftp.c:1.65     Thu Oct  3 07:33:05 2002
+++ php4/ext/ftp/ftp.c  Thu Oct  3 08:16:44 2002
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: ftp.c,v 1.65 2002/10/03 11:33:05 sesser Exp $ */
+/* $Id: ftp.c,v 1.66 2002/10/03 12:16:44 sesser Exp $ */
 
 #include "php.h"
 
@@ -768,7 +768,7 @@
 
        size = 0;
        ptr = data->buf;
-       while ((ch = php_stream_getc(instream))!=EOF && !php_stream_eof(instream)) {
+       while (!php_stream_eof(instream) && (ch = php_stream_getc(instream))!=EOF) {
                /* flush if necessary */
                if (FTP_BUFSIZE - size < 2) {
                        if (my_send(ftp, data->fd, data->buf, size) != size)
@@ -1728,7 +1728,7 @@
 
        size = 0;
        ptr = ftp->data->buf;
-       while ((ch = php_stream_getc(ftp->stream))!=EOF && 
!php_stream_eof(ftp->stream)) {
+       while (!php_stream_eof(ftp->stream) && (ch = 
+php_stream_getc(ftp->stream))!=EOF) {
 
                if (ch == '\n' && ftp->type == FTPTYPE_ASCII) {
                        *ptr++ = '\r';
Index: php4/ext/ftp/ftp.h
diff -u php4/ext/ftp/ftp.h:1.29 php4/ext/ftp/ftp.h:1.30
--- php4/ext/ftp/ftp.h:1.29     Thu Oct  3 07:33:05 2002
+++ php4/ext/ftp/ftp.h  Thu Oct  3 08:16:44 2002
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: ftp.h,v 1.29 2002/10/03 11:33:05 sesser Exp $ */
+/* $Id: ftp.h,v 1.30 2002/10/03 12:16:44 sesser Exp $ */
 
 #ifndef        FTP_H
 #define        FTP_H
@@ -49,8 +49,10 @@
        int             fd;                     /* data connection */
        ftptype_t       type;                   /* transfer type */
        char            buf[FTP_BUFSIZE];       /* data buffer */
+#if HAVE_OPENSSL_EXT
        SSL             *ssl_handle;    /* ssl handle */
        int             ssl_active;             /* flag if ssl is active or not */
+#endif
 } databuf_t;
 
 typedef struct ftpbuf



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to