aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-14 09:22:39 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-14 09:22:39 +0000
commit9ac0263c2fca2f45f85e372108328097aeadfed6 (patch)
tree9fca0601a62ab3ca4437e617fb198ac0b8055550
parent2dbc92b07d903fa6db9eb1c79001c8a7d8896ca5 (diff)
downloadruby-9ac0263c2fca2f45f85e372108328097aeadfed6.tar.gz
* regexec.c (match_at): add end point to enclen's argument.
This only effect on compilinig with -DONIG_DEBUG_MATCH. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--regexec.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 15995f29ee..a923349259 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jul 14 18:18:05 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regexec.c (match_at): add end point to enclen's argument.
+ This only effect on compilinig with -DONIG_DEBUG_MATCH.
+
Tue Jul 13 21:34:17 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/readline/readline.c: libedit is missing declaration of
diff --git a/regexec.c b/regexec.c
index c011480ec8..24422b1671 100644
--- a/regexec.c
+++ b/regexec.c
@@ -1300,13 +1300,13 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
s = (UChar* )sstart;
while (1) {
#ifdef ONIG_DEBUG_MATCH
- {
+ if (s) {
UChar *q, *bp, buf[50];
int len;
fprintf(stderr, "%4d> \"", (int )(s - str));
bp = buf;
for (i = 0, q = s; i < 7 && q < end; i++) {
- len = enclen(encode, q);
+ len = enclen(encode, q, end);
while (len-- > 0) *bp++ = *q++;
}
if (q < end) { xmemcpy(bp, "...\"", 4); bp += 4; }