diff options
Diffstat (limited to 're.c')
-rw-r--r-- | re.c | 25 |
1 files changed, 0 insertions, 25 deletions
@@ -462,7 +462,6 @@ rb_reg_desc(const char *s, long len, VALUE re) if (RBASIC(re)->flags & REG_ENCODING_NONE) rb_str_buf_cat2(str, "n"); } - OBJ_INFECT(str, re); return str; } @@ -488,7 +487,6 @@ rb_reg_source(VALUE re) rb_reg_check(re); str = rb_str_dup(RREGEXP_SRC(re)); - if (OBJ_TAINTED(re)) OBJ_TAINT(str); return str; } @@ -647,7 +645,6 @@ rb_reg_str_with_term(VALUE re, int term) } rb_enc_copy(str, re); - OBJ_INFECT(str, re); return str; } @@ -1337,7 +1334,6 @@ match_set_string(VALUE m, VALUE string, long pos, long len) if (err) rb_memerror(); rmatch->regs.beg[0] = pos; rmatch->regs.end[0] = pos + len; - OBJ_INFECT(match, string); } void @@ -1601,20 +1597,14 @@ rb_reg_search0(VALUE re, VALUE str, long pos, int reverse, int set_backref_str) onig_region_free(regs, 0); if (err) rb_memerror(); } - else { - FL_UNSET(match, FL_TAINT); - } if (set_backref_str) { RMATCH(match)->str = rb_str_new4(str); - OBJ_INFECT(match, str); } RMATCH(match)->regexp = re; rb_backref_set(match); - OBJ_INFECT(match, re); - return result; } @@ -1685,18 +1675,12 @@ rb_reg_start_with_p(VALUE re, VALUE str) onig_region_free(regs, 0); if (err) rb_memerror(); } - else { - FL_UNSET(match, FL_TAINT); - } RMATCH(match)->str = rb_str_new4(str); - OBJ_INFECT(match, str); RMATCH(match)->regexp = re; rb_backref_set(match); - OBJ_INFECT(match, re); - return true; } @@ -1740,7 +1724,6 @@ rb_reg_nth_match(int nth, VALUE match) end = END(nth); len = end - start; str = rb_str_subseq(RMATCH(match)->str, start, len); - OBJ_INFECT(str, match); return str; } @@ -1773,7 +1756,6 @@ rb_reg_match_pre(VALUE match) regs = RMATCH_REGS(match); if (BEG(0) == -1) return Qnil; str = rb_str_subseq(RMATCH(match)->str, 0, BEG(0)); - if (OBJ_TAINTED(match)) OBJ_TAINT(str); return str; } @@ -1803,7 +1785,6 @@ rb_reg_match_post(VALUE match) str = RMATCH(match)->str; pos = END(0); str = rb_str_subseq(str, pos, RSTRING_LEN(str) - pos); - if (OBJ_TAINTED(match)) OBJ_TAINT(str); return str; } @@ -1855,7 +1836,6 @@ match_array(VALUE match, int start) VALUE ary; VALUE target; int i; - int taint = OBJ_TAINTED(match); match_check(match); regs = RMATCH_REGS(match); @@ -1868,7 +1848,6 @@ match_array(VALUE match, int start) } else { VALUE str = rb_str_subseq(target, regs->beg[i], regs->end[i]-regs->beg[i]); - if (taint) OBJ_TAINT(str); rb_ary_push(ary, str); } } @@ -2129,8 +2108,6 @@ match_to_s(VALUE match) match_check(match); if (NIL_P(str)) str = rb_str_new(0,0); - if (OBJ_TAINTED(match)) OBJ_TAINT(str); - if (OBJ_TAINTED(RMATCH(match)->str)) OBJ_TAINT(str); return str; } @@ -2891,7 +2868,6 @@ rb_reg_initialize_str(VALUE obj, VALUE str, int options, onig_errmsg_buffer err, } ret = rb_reg_initialize(obj, RSTRING_PTR(str), RSTRING_LEN(str), enc, options, err, sourcefile, sourceline); - OBJ_INFECT(obj, str); if (ret == 0) reg_set_source(obj, str, str_enc); return ret; } @@ -3580,7 +3556,6 @@ rb_reg_quote(VALUE str) t += rb_enc_mbcput(c, t, enc); } rb_str_resize(tmp, t - RSTRING_PTR(tmp)); - OBJ_INFECT(tmp, str); return tmp; } |