diff options
author | Nuno Lopes <nlopess@php.net> | 2008-01-13 14:44:29 +0000 |
---|---|---|
committer | Nuno Lopes <nlopess@php.net> | 2008-01-13 14:44:29 +0000 |
commit | 18107c0b44a39ebbc2b5f7fab399c0f0e1679196 (patch) | |
tree | 8268ef076ede0e93c35629cb906b14f9bd8d67da /ext/pcre/php_pcre.c | |
parent | 4c501a0ab62a1978d4583a4a96c557c420aed22f (diff) | |
download | php-git-18107c0b44a39ebbc2b5f7fab399c0f0e1679196.tar.gz |
Fixed bug #42945 (preg_split() swallows part of the string)
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r-- | ext/pcre/php_pcre.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 9e2187d649..07abff432f 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1562,7 +1562,9 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subjec } - if (!no_empty || start_offset != subject_len) + start_offset = last_match - subject; /* the offset might have been incremented, but without further successful matches */ + + if (!no_empty || start_offset < subject_len) { if (offset_capture) { /* Add the last (match, offset) pair to the return value */ |