Skip to content

Commit 536a327

Browse files
committed
* 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
1 parent 0869d46 commit 536a327

File tree

6 files changed

+16
-11
lines changed

6 files changed

+16
-11
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Sat Apr 13 20:28:08 2013 NARUSE, Yui <naruse@ruby-lang.org>
2+
3+
* Merge Onigmo 5.13.4 f22cf2e566712cace60d17f84d63119d7c5764ee.
4+
[bug] fix problem with optimization of \z (Issue #16) [Bug #8210]
5+
16
Sat Apr 13 18:56:15 2013 NAKAMURA Usaku <usa@ruby-lang.org>
27

38
* ext/ripper/depend: parse.h and id.h may be created on topdir.

include/ruby/oniguruma.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
**********************************************************************/
66
/*-
77
* Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
8-
* Copyright (c) 2011-2012 K.Takata <kentkt AT csc DOT jp>
8+
* Copyright (c) 2011-2013 K.Takata <kentkt AT csc DOT jp>
99
* All rights reserved.
1010
*
1111
* Redistribution and use in source and binary forms, with or without
@@ -40,7 +40,7 @@ extern "C" {
4040
#define ONIGURUMA
4141
#define ONIGURUMA_VERSION_MAJOR 5
4242
#define ONIGURUMA_VERSION_MINOR 13
43-
#define ONIGURUMA_VERSION_TEENY 3
43+
#define ONIGURUMA_VERSION_TEENY 4
4444

4545
#ifdef __cplusplus
4646
# ifndef HAVE_PROTOTYPES

regcomp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4990,7 +4990,7 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env)
49904990
int i, z;
49914991
CClassNode* cc = NCCLASS(node);
49924992

4993-
/* no need to check ignore case. (setted in setup_tree()) */
4993+
/* no need to check ignore case. (set in setup_tree()) */
49944994

49954995
if (IS_NOT_NULL(cc->mbuf) || IS_NCCLASS_NOT(cc)) {
49964996
OnigDistance min = ONIGENC_MBC_MINLEN(env->enc);

regexec.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4020,15 +4020,14 @@ onig_search_gpos(regex_t* reg, const UChar* str, const UChar* end,
40204020
start = min_semi_end - reg->anchor_dmax;
40214021
if (start < end)
40224022
start = onigenc_get_right_adjust_char_head(reg->enc, str, start, end);
4023-
else { /* match with empty at end */
4024-
start = onigenc_get_prev_char_head(reg->enc, str, end, end);
4025-
}
40264023
}
40274024
if ((OnigDistance )(max_semi_end - (range - 1)) < reg->anchor_dmin) {
40284025
range = max_semi_end - reg->anchor_dmin + 1;
40294026
}
40304027

4031-
if (start >= range) goto mismatch_no_msa;
4028+
if (start > range) goto mismatch_no_msa;
4029+
/* If start == range, match with empty at end.
4030+
Backward search is used. */
40324031
}
40334032
else {
40344033
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,
42584257
ONIG_STATE_DEC_THREAD(reg);
42594258

42604259
/* If result is mismatch and no FIND_NOT_EMPTY option,
4261-
then the region is not setted in match_at(). */
4260+
then the region is not set in match_at(). */
42624261
if (IS_FIND_NOT_EMPTY(reg->options) && region
42634262
#ifdef USE_POSIX_API_REGION_OPTION
42644263
&& !IS_POSIX_REGION(option)

regint.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ typedef struct _OnigStackType {
803803
struct {
804804
int num; /* memory num */
805805
UChar *pstr; /* start/end position */
806-
/* Following information is setted, if this stack type is MEM-START */
806+
/* Following information is set, if this stack type is MEM-START */
807807
OnigStackIndex start; /* prev. info (for backtrack "(...)*" ) */
808808
OnigStackIndex end; /* prev. info (for backtrack "(...)*" ) */
809809
} mem;
@@ -876,6 +876,7 @@ typedef void hash_table_type;
876876
#include "ruby/st.h"
877877
typedef st_data_t hash_data_type;
878878
#else
879+
#include "st.h"
879880
typedef uintptr_t hash_data_type;
880881
#endif
881882

regparse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,7 +1580,7 @@ str_node_split_last_char(StrNode* sn, OnigEncoding enc)
15801580

15811581
if (sn->end > sn->s) {
15821582
p = onigenc_get_prev_char_head(enc, sn->s, sn->end, sn->end);
1583-
if (p && p > sn->s) { /* can be splitted. */
1583+
if (p && p > sn->s) { /* can be split. */
15841584
n = node_new_str(p, sn->end);
15851585
if (IS_NOT_NULL(n) && (sn->flag & NSTR_RAW) != 0)
15861586
NSTRING_SET_RAW(n);
@@ -3201,7 +3201,7 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
32013201
else if (c == '[') {
32023202
if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_POSIX_BRACKET) && (PPEEK_IS(':'))) {
32033203
OnigCodePoint send[] = { (OnigCodePoint )':', (OnigCodePoint )']' };
3204-
tok->backp = p; /* point at '[' is readed */
3204+
tok->backp = p; /* point at '[' is read */
32053205
PINC;
32063206
if (str_exist_check_with_esc(send, 2, p, end,
32073207
(OnigCodePoint )']', enc, syn)) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy