summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--include/ruby/oniguruma.h2
-rw-r--r--regcomp.c13
3 files changed, 15 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 06a7148b62..379c2df715 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jul 4 10:04:11 2013 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regcomp.c (): Merge Onigmo 5.13.5 23b523076d6f1161.
+ https://bugs.ruby-lang.org/issues/8583
+
Thu Jul 4 00:36:03 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* internal.h (SIGNED_INTEGER_MAX): suppress warning C4146 on VC6.
diff --git a/include/ruby/oniguruma.h b/include/ruby/oniguruma.h
index 0a78f1c14e..6a26ee4aaa 100644
--- a/include/ruby/oniguruma.h
+++ b/include/ruby/oniguruma.h
@@ -40,7 +40,7 @@ extern "C" {
#define ONIGURUMA
#define ONIGURUMA_VERSION_MAJOR 5
#define ONIGURUMA_VERSION_MINOR 13
-#define ONIGURUMA_VERSION_TEENY 4
+#define ONIGURUMA_VERSION_TEENY 5
#ifdef __cplusplus
# ifndef HAVE_PROTOTYPES
diff --git a/regcomp.c b/regcomp.c
index 1373ff2eb4..705e0faad7 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -1943,7 +1943,12 @@ renumber_by_map(Node* node, GroupNumRemap* map)
r = renumber_by_map(NQTFR(node)->target, map);
break;
case NT_ENCLOSE:
- r = renumber_by_map(NENCLOSE(node)->target, map);
+ {
+ EncloseNode* en = NENCLOSE(node);
+ if (en->type == ENCLOSE_CONDITION)
+ en->regnum = map[en->regnum].new_val;
+ r = renumber_by_map(en->target, map);
+ }
break;
case NT_BREF:
@@ -4090,8 +4095,8 @@ restart:
( BIT_NT_LIST | BIT_NT_ALT | BIT_NT_STR | BIT_NT_CCLASS | BIT_NT_CTYPE | \
BIT_NT_CANY | BIT_NT_ANCHOR | BIT_NT_ENCLOSE | BIT_NT_QTFR | BIT_NT_CALL )
-#define ALLOWED_ENCLOSE_IN_LB ( ENCLOSE_MEMORY )
-#define ALLOWED_ENCLOSE_IN_LB_NOT 0
+#define ALLOWED_ENCLOSE_IN_LB ( ENCLOSE_MEMORY | ENCLOSE_OPTION )
+#define ALLOWED_ENCLOSE_IN_LB_NOT ENCLOSE_OPTION
#define ALLOWED_ANCHOR_IN_LB \
( ANCHOR_LOOK_BEHIND | ANCHOR_LOOK_BEHIND_NOT | ANCHOR_BEGIN_LINE | \
@@ -6646,7 +6651,7 @@ print_indent_tree(FILE* f, Node* node, int indent)
fprintf(f, "<enclose:%"PRIxPTR"> ", (intptr_t)node);
switch (NENCLOSE(node)->type) {
case ENCLOSE_OPTION:
- fprintf(f, "option:%d\n", NENCLOSE(node)->option);
+ fprintf(f, "option:%d", NENCLOSE(node)->option);
break;
case ENCLOSE_MEMORY:
fprintf(f, "memory:%d", NENCLOSE(node)->regnum);