summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-24 05:33:32 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-24 05:33:32 +0000
commit25380b0a57d5c5442fedefe6be7f025ace5bd1b5 (patch)
tree7bcbf0962652a1a3155737f9b406953a6cdcab53 /regexec.c
parentb0d5064d4a371d6e0bca557dec9da92fe2f36286 (diff)
merges r28637 from trunk into ruby_1_9_2.
-- * 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/branches/ruby_1_9_2@28737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/regexec.c b/regexec.c
index 13b6fadee2..c78d8ea998 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; }