From 536a3274c9dab6290ce370bc432f761f23a2f52e Mon Sep 17 00:00:00 2001 From: naruse Date: Sat, 13 Apr 2013 11:30:35 +0000 Subject: [PATCH] * Merge Onigmo 5.13.4 f22cf2e566712cace60d17f84d63119d7c5764ee. [bug] fix problem with optimization of \z (Issue #16) [Bug #8210] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ include/ruby/oniguruma.h | 4 ++-- regcomp.c | 2 +- regexec.c | 9 ++++----- regint.h | 3 ++- regparse.c | 4 ++-- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 852b9d74ac..563c837453 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Apr 13 20:28:08 2013 NARUSE, Yui + + * Merge Onigmo 5.13.4 f22cf2e566712cace60d17f84d63119d7c5764ee. + [bug] fix problem with optimization of \z (Issue #16) [Bug #8210] + Sat Apr 13 18:56:15 2013 NAKAMURA Usaku * ext/ripper/depend: parse.h and id.h may be created on topdir. diff --git a/include/ruby/oniguruma.h b/include/ruby/oniguruma.h index b96773e11e..0a78f1c14e 100644 --- a/include/ruby/oniguruma.h +++ b/include/ruby/oniguruma.h @@ -5,7 +5,7 @@ **********************************************************************/ /*- * Copyright (c) 2002-2009 K.Kosako - * Copyright (c) 2011-2012 K.Takata + * Copyright (c) 2011-2013 K.Takata * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,7 +40,7 @@ extern "C" { #define ONIGURUMA #define ONIGURUMA_VERSION_MAJOR 5 #define ONIGURUMA_VERSION_MINOR 13 -#define ONIGURUMA_VERSION_TEENY 3 +#define ONIGURUMA_VERSION_TEENY 4 #ifdef __cplusplus # ifndef HAVE_PROTOTYPES diff --git a/regcomp.c b/regcomp.c index ff74e292ed..1373ff2eb4 100644 --- a/regcomp.c +++ b/regcomp.c @@ -4990,7 +4990,7 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env) int i, z; CClassNode* cc = NCCLASS(node); - /* no need to check ignore case. (setted in setup_tree()) */ + /* no need to check ignore case. (set in setup_tree()) */ if (IS_NOT_NULL(cc->mbuf) || IS_NCCLASS_NOT(cc)) { OnigDistance min = ONIGENC_MBC_MINLEN(env->enc); diff --git a/regexec.c b/regexec.c index 3b75545bf0..997849695e 100644 --- a/regexec.c +++ b/regexec.c @@ -4020,15 +4020,14 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end, start = min_semi_end - reg->anchor_dmax; if (start < end) start = onigenc_get_right_adjust_char_head(reg->enc, str, start, end); - else { /* match with empty at end */ - start = onigenc_get_prev_char_head(reg->enc, str, end, end); - } } if ((OnigDistance )(max_semi_end - (range - 1)) < reg->anchor_dmin) { range = max_semi_end - reg->anchor_dmin + 1; } - if (start >= range) goto mismatch_no_msa; + if (start > range) goto mismatch_no_msa; + /* If start == range, match with empty at end. + Backward search is used. */ } else { if ((OnigDistance )(min_semi_end - range) > reg->anchor_dmax) { @@ -4258,7 +4257,7 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end, ONIG_STATE_DEC_THREAD(reg); /* If result is mismatch and no FIND_NOT_EMPTY option, - then the region is not setted in match_at(). */ + then the region is not set in match_at(). */ if (IS_FIND_NOT_EMPTY(reg->options) && region #ifdef USE_POSIX_API_REGION_OPTION && !IS_POSIX_REGION(option) diff --git a/regint.h b/regint.h index 9192a67fde..a3e92ee217 100644 --- a/regint.h +++ b/regint.h @@ -803,7 +803,7 @@ typedef struct _OnigStackType { struct { int num; /* memory num */ UChar *pstr; /* start/end position */ - /* Following information is setted, if this stack type is MEM-START */ + /* Following information is set, if this stack type is MEM-START */ OnigStackIndex start; /* prev. info (for backtrack "(...)*" ) */ OnigStackIndex end; /* prev. info (for backtrack "(...)*" ) */ } mem; @@ -876,6 +876,7 @@ typedef void hash_table_type; #include "ruby/st.h" typedef st_data_t hash_data_type; #else +#include "st.h" typedef uintptr_t hash_data_type; #endif diff --git a/regparse.c b/regparse.c index 82af0a8fc3..774ee0a960 100644 --- a/regparse.c +++ b/regparse.c @@ -1580,7 +1580,7 @@ str_node_split_last_char(StrNode* sn, OnigEncoding enc) if (sn->end > sn->s) { p = onigenc_get_prev_char_head(enc, sn->s, sn->end, sn->end); - if (p && p > sn->s) { /* can be splitted. */ + if (p && p > sn->s) { /* can be split. */ n = node_new_str(p, sn->end); if (IS_NOT_NULL(n) && (sn->flag & NSTR_RAW) != 0) NSTRING_SET_RAW(n); @@ -3201,7 +3201,7 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env) else if (c == '[') { if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_POSIX_BRACKET) && (PPEEK_IS(':'))) { OnigCodePoint send[] = { (OnigCodePoint )':', (OnigCodePoint )']' }; - tok->backp = p; /* point at '[' is readed */ + tok->backp = p; /* point at '[' is read */ PINC; if (str_exist_check_with_esc(send, 2, p, end, (OnigCodePoint )']', enc, syn)) {