]> granicus.if.org Git - php/commitdiff
Revert unintended bits from "Added a warning message" commit
authorIlia Alshanetsky <iliaa@php.net>
Mon, 31 Mar 2008 22:44:38 +0000 (22:44 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 31 Mar 2008 22:44:38 +0000 (22:44 +0000)
ext/standard/file.c

index b45ca3d9c3afcd9752faa5c097ebc4ef3e6cd20e..9e23b9257db359de0191d5bfd48e3267d7bb0193 100644 (file)
@@ -622,8 +622,8 @@ PHP_FUNCTION(file_put_contents)
        long flags = ((argc < 3) && UG(unicode)) ? PHP_FILE_TEXT : 0;
        zval *zcontext = NULL;
        php_stream_context *context = NULL;
+       char mode[3] = { 'w', 0, 0 };
        php_stream *srcstream = NULL;
-       char mode[3] = "wb";
 
        if (zend_parse_parameters(argc TSRMLS_CC, "Zz/|lr!", &ppfilename, &data, &flags, &zcontext) == FAILURE) {
                return;
@@ -659,10 +659,6 @@ PHP_FUNCTION(file_put_contents)
                RETURN_FALSE;
        }
 
-       if (mode[0] = 'c') {
-               php_stream_truncate_set_size(stream, 0);
-       }
-
        switch (Z_TYPE_P(data)) {
                case IS_RESOURCE:
                        numchars = php_stream_copy_to_stream(srcstream, stream, PHP_STREAM_COPY_ALL);