Skip to content

Commit 106d6a7

Browse files
author
Rui Hirokawa
committed
fixed problem that ereg_replace() couldn't match with line stand/end marker.
1 parent d10a337 commit 106d6a7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/ereg/ereg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const cha
371371
&& subs[walk[1] - '0'].rm_so > -1
372372
&& subs[walk[1] - '0'].rm_eo > -1
373373
/* this next case shouldn't happen. it does. */
374-
&& subs[walk[1] - '0'].rm_so < subs[walk[1] - '0'].rm_eo) {
374+
&& subs[walk[1] - '0'].rm_so <= subs[walk[1] - '0'].rm_eo) {
375375
tmp = subs[walk[1] - '0'].rm_eo
376376
- subs[walk[1] - '0'].rm_so;
377377
memcpy (walkbuf,

ext/standard/reg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const cha
371371
&& subs[walk[1] - '0'].rm_so > -1
372372
&& subs[walk[1] - '0'].rm_eo > -1
373373
/* this next case shouldn't happen. it does. */
374-
&& subs[walk[1] - '0'].rm_so < subs[walk[1] - '0'].rm_eo) {
374+
&& subs[walk[1] - '0'].rm_so <= subs[walk[1] - '0'].rm_eo) {
375375
tmp = subs[walk[1] - '0'].rm_eo
376376
- subs[walk[1] - '0'].rm_so;
377377
memcpy (walkbuf,

0 commit comments

Comments
 (0)