helly Sun Jan 14 19:09:55 2007 UTC
Modified files:
/php-src/main/streams memory.c
Log:
- Fix readonly mode to 'rb'
http://cvs.php.net/viewvc.cgi/php-src/main/streams/memory.c?r1=1.29&r2=1.30&diff_format=u
Index: php-src/main/streams/memory.c
diff -u php-src/main/streams/memory.c:1.29 php-src/main/streams/memory.c:1.30
--- php-src/main/streams/memory.c:1.29 Mon Jan 1 09:29:35 2007
+++ php-src/main/streams/memory.c Sun Jan 14 19:09:55 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: memory.c,v 1.29 2007/01/01 09:29:35 sebastian Exp $ */
+/* $Id: memory.c,v 1.30 2007/01/14 19:09:55 helly Exp $ */
#define _GNU_SOURCE
#include "php.h"
@@ -266,7 +266,7 @@
self->mode = mode;
self->owner_ptr = NULL;
- stream = php_stream_alloc(&php_stream_memory_ops, self, 0, mode &
TEMP_STREAM_READONLY ? "r+b" : "w+b");
+ stream = php_stream_alloc(&php_stream_memory_ops, self, 0, mode &
TEMP_STREAM_READONLY ? "rb" : "w+b");
stream->flags |= PHP_STREAM_FLAG_NO_BUFFER;
return stream;
}
@@ -520,9 +520,9 @@
self->smax = max_memory_usage;
self->mode = mode;
self->meta = NULL;
- stream = php_stream_alloc(&php_stream_temp_ops, self, 0, mode &
TEMP_STREAM_READONLY ? "r+b" : "w+b");
+ stream = php_stream_alloc(&php_stream_temp_ops, self, 0, mode &
TEMP_STREAM_READONLY ? "rb" : "w+b");
stream->flags |= PHP_STREAM_FLAG_NO_BUFFER;
- self->innerstream = php_stream_memory_create(mode);
+ self->innerstream = php_stream_memory_create_rel(mode);
((php_stream_memory_data*)self->innerstream->abstract)->owner_ptr =
&self->innerstream;
return stream;
@@ -684,7 +684,7 @@
stream->ops = &php_stream_rfc2397_ops;
ts = (php_stream_temp_data*)stream->abstract;
assert(ts != NULL);
- ts->mode = mode && mode[0] == 'r' ? TEMP_STREAM_READONLY : 0;
+ ts->mode = mode && mode[0] == 'r' && mode[1] != '+' ?
TEMP_STREAM_READONLY : 0;
ts->meta = meta;
}
efree(comma);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php