]> granicus.if.org Git - php/commitdiff
- Fix file()
authorJani Taskinen <jani@php.net>
Wed, 9 Dec 2009 19:33:14 +0000 (19:33 +0000)
committerJani Taskinen <jani@php.net>
Wed, 9 Dec 2009 19:33:14 +0000 (19:33 +0000)
ext/standard/file.c

index 1e2bd6c097c52ce4a3d9dc5e7e007e1275383094..7ba685c11dd86aead5f564505fad3c683b03becd 100644 (file)
@@ -796,7 +796,6 @@ PHP_FUNCTION(file)
        zend_bool use_include_path;
        zend_bool include_new_line;
        zend_bool skip_blank_lines;
-       zend_bool text_mode;
        php_stream *stream;
        zval *zcontext = NULL;
        php_stream_context *context = NULL;
@@ -813,14 +812,13 @@ PHP_FUNCTION(file)
        use_include_path = flags & PHP_FILE_USE_INCLUDE_PATH;
        include_new_line = !(flags & PHP_FILE_IGNORE_NEW_LINES);
        skip_blank_lines = flags & PHP_FILE_SKIP_EMPTY_LINES;
-       text_mode = !(flags & PHP_FILE_BINARY);
 
        context = php_stream_context_from_zval(zcontext, flags & PHP_FILE_NO_DEFAULT_CONTEXT);
        if (php_stream_path_param_encode(ppfilename, &filename, &filename_len, REPORT_ERRORS, context) == FAILURE) {
                RETURN_FALSE;
        }
 
-       stream = php_stream_open_wrapper_ex(filename, text_mode ? "rt" : "rb", (use_include_path ? USE_PATH : 0) | REPORT_ERRORS, NULL, context);
+       stream = php_stream_open_wrapper_ex(filename, (flags & PHP_FILE_TEXT) ? "rt" : "rb", (use_include_path ? USE_PATH : 0) | REPORT_ERRORS, NULL, context);
        if (!stream) {
                RETURN_FALSE;
        }