1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 01:32:22 +01:00

Fixed bug #48313 (fgetcsv() does not return null for empty rows)

This commit is contained in:
Ilia Alshanetsky
2009-05-18 18:45:30 +00:00
parent 9ece649f7c
commit e99d4e9adc

View File

@@ -2343,8 +2343,12 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
}
/* 3. Now pass our field back to php */
*comp_end = '\0';
add_next_index_stringl(return_value, temp, comp_end - temp, 1);
if (comp_end - temp) {
*comp_end = '\0';
add_next_index_stringl(return_value, temp, comp_end - temp, 1);
} else {
add_next_index_null(return_value);
}
} while (inc_len > 0);
out: