diff options
author | Alexander Feldman <sasha@php.net> | 2001-04-17 21:54:29 +0000 |
---|---|---|
committer | Alexander Feldman <sasha@php.net> | 2001-04-17 21:54:29 +0000 |
commit | 750f87ccce62f0a33133098a7b46a458bc0a7b01 (patch) | |
tree | a1e7a62675da11fd6a57c8f464df5811dfaacb4e | |
parent | 86c5460229fc46c7d897d6232c1b5b635e476d31 (diff) | |
download | php-git-750f87ccce62f0a33133098a7b46a458bc0a7b01.tar.gz |
Merged the patch of the buffering patch as it fixes a pretty major bug.
-rw-r--r-- | ext/standard/file.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c index 0db94098ee..8bf4442da3 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -919,7 +919,7 @@ PHP_FUNCTION(fgets) /* needed because recv doesnt put a null at the end*/ memset(buf,0,len+1); #ifdef HAVE_FLUSHIO - if (!issock) { + if (type == le_fopen) { fseek((FILE*)what, 0, SEEK_CUR); } #endif @@ -967,7 +967,7 @@ PHP_FUNCTION(fgetc) { } #ifdef HAVE_FLUSHIO - if (!issock) { + if (type == le_fopen) { fseek((FILE*)what, 0, SEEK_CUR); } #endif @@ -1170,7 +1170,9 @@ PHP_FUNCTION(fwrite) ret = SOCK_WRITEL((*arg2)->value.str.val,num_bytes,socketd); } else { #ifdef HAVE_FLUSHIO - fseek((FILE*)what, 0, SEEK_CUR); + if (type == le_fopen) { + fseek((FILE*)what, 0, SEEK_CUR); + } #endif ret = fwrite((*arg2)->value.str.val,1,num_bytes,(FILE*)what); } @@ -1812,7 +1814,9 @@ PHP_FUNCTION(fread) if (!issock) { #ifdef HAVE_FLUSHIO - fseek((FILE*)what, 0, SEEK_CUR); + if (type == le_fopen) { + fseek((FILE*)what, 0, SEEK_CUR); + } #endif return_value->value.str.len = fread(return_value->value.str.val, 1, len, (FILE*)what); return_value->value.str.val[return_value->value.str.len] = 0; |