summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/file.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c
index d2874d8cbb..b55fd49b5b 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -2244,11 +2244,10 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
state = 0;
break;
default:
- if ((escape_char == enclosure && *bptr == escape_char && *(bptr+1) == escape_char)
- || (escape_char != enclosure && *bptr == escape_char)) {
- state = 1;
- } else if (*bptr == enclosure) {
+ if (*bptr == enclosure) {
state = 2;
+ } else if (*bptr == escape_char) {
+ state = 1;
}
bptr++;
break;