diff options
author | Andrew Skalski <askalski@php.net> | 2000-05-22 21:16:58 +0000 |
---|---|---|
committer | Andrew Skalski <askalski@php.net> | 2000-05-22 21:16:58 +0000 |
commit | 3ac4c96641ab50319d87eb0dc220b215e9d06b5f (patch) | |
tree | 8e6dec4f009af7df37f5950f0e598756d9fb4239 /ext/ftp/php_ftp.c | |
parent | 072755ca8d26bd5b182f4a025fecc290fed349d2 (diff) | |
download | php-git-3ac4c96641ab50319d87eb0dc220b215e9d06b5f.tar.gz |
applied Luca Montecchiani's win32 fixes (open files in binary mode
using the "b" fopen flag, and use closesocket rather than close
when closing sockets)
Diffstat (limited to 'ext/ftp/php_ftp.c')
-rw-r--r-- | ext/ftp/php_ftp.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index 4f967d1ee0..e76f3c7096 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -551,7 +551,11 @@ PHP_FUNCTION(ftp_get) RETURN_FALSE; } +#if defined(WIN32) || defined(WINNT) + if ((outfp = V_FOPEN(arg2->value.str.val, "wb")) == NULL) { +#else if ((outfp = V_FOPEN(arg2->value.str.val, "w")) == NULL) { +#endif fclose(tmpfp); php_error(E_WARNING, "error opening %s", arg2->value.str.val); RETURN_FALSE; @@ -635,7 +639,11 @@ PHP_FUNCTION(ftp_put) convert_to_string(arg3); XTYPE(xtype, arg4); +#if defined(WIN32) || defined(WINNT) + if ((infp = V_FOPEN(arg3->value.str.val, "rb")) == NULL) { +#else if ((infp = V_FOPEN(arg3->value.str.val, "r")) == NULL) { +#endif php_error(E_WARNING, "error opening %s", arg3->value.str.val); RETURN_FALSE; } |