summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoriyoshi Koizumi <moriyoshi@php.net>2004-01-18 20:29:34 +0000
committerMoriyoshi Koizumi <moriyoshi@php.net>2004-01-18 20:29:34 +0000
commitabfda09eda3aeedde10a653875d00a1f00bcae16 (patch)
tree5ad02fa7380a5b30e8650a0dfbf9465a2c802345
parentc1df34cae0e79a166bb310f50c520e65f74f8440 (diff)
downloadphp-git-abfda09eda3aeedde10a653875d00a1f00bcae16.tar.gz
Fix fgetcsv() to reflect the change on 4.3.5 behaviour.
-rw-r--r--ext/standard/file.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c
index f2982c388c..8853168182 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -1904,6 +1904,7 @@ PHP_FUNCTION(fgetcsv)
/* real enclosure */
memcpy(tptr, hunk_begin, bptr - hunk_begin - 1);
tptr += (bptr - hunk_begin - 1);
+ hunk_begin = bptr;
goto quit_loop_2;
}
memcpy(tptr, hunk_begin, bptr - hunk_begin);
@@ -1929,6 +1930,7 @@ PHP_FUNCTION(fgetcsv)
/* real enclosure */
memcpy(tptr, hunk_begin, bptr - hunk_begin - 1);
tptr += (bptr - hunk_begin - 1);
+ hunk_begin = bptr;
goto quit_loop_2;
case 1:
bptr += inc_len;
@@ -1959,7 +1961,6 @@ PHP_FUNCTION(fgetcsv)
/* break is omitted intentionally */
case 1:
if (*bptr == delimiter) {
- bptr += inc_len;
goto quit_loop_3;
}
break;
@@ -1971,6 +1972,9 @@ PHP_FUNCTION(fgetcsv)
}
quit_loop_3:
+ memcpy(tptr, hunk_begin, bptr - hunk_begin);
+ tptr += (bptr - hunk_begin);
+ bptr += inc_len;
comp_end = tptr;
} else {
/* 2B. Handle non-enclosure field */