sasha Tue Apr 17 14:54:30 2001 EDT
Modified files: (Branch: PHP_4_0_5)
/php4/ext/standard file.c
Log:
Merged the patch of the buffering patch as it fixes a pretty major bug.
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.148.2.1 php4/ext/standard/file.c:1.148.2.2
--- php4/ext/standard/file.c:1.148.2.1 Wed Mar 28 01:01:27 2001
+++ php4/ext/standard/file.c Tue Apr 17 14:54:29 2001
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.148.2.1 2001/03/28 09:01:27 romolo Exp $ */
+/* $Id: file.c,v 1.148.2.2 2001/04/17 21:54:29 sasha Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -919,7 +919,7 @@
/* 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 @@
}
#ifdef HAVE_FLUSHIO
- if (!issock) {
+ if (type == le_fopen) {
fseek((FILE*)what, 0, SEEK_CUR);
}
#endif
@@ -1170,7 +1170,9 @@
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 @@
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;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]