@@ -1943,7 +1943,11 @@ static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_obje
19431943 zval retval ;
19441944
19451945 /* 1) use fgetcsv? 2) overloaded call the function, 3) do it directly */
1946- if (SPL_HAS_FLAG (intern -> flags , SPL_FILE_OBJECT_READ_CSV ) || intern -> u .file .func_getCurr -> common .scope != spl_ce_SplFileObject ) {
1946+ if (SPL_HAS_FLAG (intern -> flags , SPL_FILE_OBJECT_READ_CSV )) {
1947+ return spl_filesystem_file_read_csv (intern , intern -> u .file .delimiter , intern -> u .file .enclosure , intern -> u .file .escape , NULL );
1948+ }
1949+ if (intern -> u .file .func_getCurr -> common .scope != spl_ce_SplFileObject ) {
1950+ zend_execute_data * execute_data = EG (current_execute_data );
19471951 spl_filesystem_file_free_line (intern );
19481952
19491953 if (php_stream_eof (intern -> u .file .stream )) {
@@ -1952,11 +1956,6 @@ static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_obje
19521956 }
19531957 return FAILURE ;
19541958 }
1955- if (SPL_HAS_FLAG (intern -> flags , SPL_FILE_OBJECT_READ_CSV )) {
1956- return spl_filesystem_file_read_csv (intern , intern -> u .file .delimiter , intern -> u .file .enclosure , intern -> u .file .escape , NULL );
1957- }
1958-
1959- zend_execute_data * execute_data = EG (current_execute_data );
19601959 zend_call_method_with_0_params (Z_OBJ_P (this_ptr ), Z_OBJCE_P (ZEND_THIS ), & intern -> u .file .func_getCurr , "getCurrentLine" , & retval );
19611960 if (Z_ISUNDEF (retval )) {
19621961 return FAILURE ;
@@ -2733,8 +2732,8 @@ PHP_METHOD(SplFileObject, seek)
27332732 }
27342733 }
27352734 if (line_pos > 0 ) {
2736- intern -> u .file .current_line_num ++ ;
27372735 if (!SPL_HAS_FLAG (intern -> flags , SPL_FILE_OBJECT_READ_AHEAD )) {
2736+ intern -> u .file .current_line_num ++ ;
27382737 spl_filesystem_file_free_line (intern );
27392738 }
27402739 }
0 commit comments