summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-15 16:18:41 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-15 16:18:41 (GMT)
commitd2a5354255bab4d74c710ee8ff21f43998f33095 (patch)
tree1ec7bb66dc38e3d46bc69892fa6d18184386ec72 /regexec.c
parentd198d64e0464c141f70c49880bf511ac3dcd1162 (diff)
* reg*.c: Merge Onigmo 5.15.0 38a870960aa7370051a3544
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/regexec.c b/regexec.c
index 87b7759..1336468 100644
--- a/regexec.c
+++ b/regexec.c
@@ -1397,7 +1397,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
(int )(end - str), (int )(sstart - str));
#endif
- STACK_PUSH_ENSURED(STK_ALT, (UChar *)FinishCode); /* bottom stack */
+ STACK_PUSH_ENSURED(STK_ALT, (UChar* )FinishCode); /* bottom stack */
best_len = ONIG_MISMATCH;
s = (UChar* )sstart;
pkeep = (UChar* )sstart;
@@ -1406,7 +1406,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
if (s) {
UChar *q, *bp, buf[50];
int len;
- fprintf(stderr, "%4d> \"", (*p == OP_FINISH) ? -1 : (int )(s - str));
+ fprintf(stderr, "%4"PRIdPTR"> \"", (*p == OP_FINISH) ? (ptrdiff_t )-1 : s - str);
bp = buf;
if (*p != OP_FINISH) { /* s may not be a valid pointer if OP_FINISH. */
for (i = 0, q = s; i < 7 && q < end; i++) {
@@ -1419,6 +1419,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
*bp = 0;
fputs((char* )buf, stderr);
for (i = 0; i < 20 - (bp - buf); i++) fputc(' ', stderr);
+ fprintf(stderr, "%4"PRIdPTR":", (p == FinishCode) ? (ptrdiff_t )-1 : p - reg->p);
onig_print_compiled_byte_code(stderr, p, p + strlen((char *)p), NULL, encode);
fprintf(stderr, "\n");
}
@@ -4183,7 +4184,7 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end,
prev = s;
s += enclen(reg->enc, s, end);
- if ((reg->anchor & ANCHOR_LOOK_BEHIND) == 0) {
+ if ((reg->anchor & (ANCHOR_LOOK_BEHIND | ANCHOR_PREC_READ_NOT)) == 0) {
while (!ONIGENC_IS_MBC_NEWLINE_EX(reg->enc, prev, str, end, reg->options, 0)
&& s < range) {
prev = s;