summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-16 09:26:38 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-16 09:26:38 +0000
commitbe458259da8b3e2623e426fd3354690e01da7a90 (patch)
tree10d8ceb3eed3fc1946701e631ccf16102d777c1c /re.c
parent7389bac70795aebdf532c13126f411d140c86045 (diff)
* eval.c (rb_call0): reorganize "return" event post.
* object.c (str_to_id): warn for NUL containing strings. * re.c (make_regexp): need to free internal regexp structure when compilation fails. [ruby-talk:133228] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/re.c b/re.c
index a8a82d4..46aa8e5 100644
--- a/re.c
+++ b/re.c
@@ -641,6 +641,7 @@ make_regexp(s, len, flags)
err = re_compile_pattern(s, len, rp);
if (err != NULL) {
+ re_free_pattern(rp);
rb_reg_raise(s, len, err, 0);
}
return rp;
@@ -1627,7 +1628,7 @@ rb_reg_match_m(re, str)
* options are propagated, and new options may not be specified (a change as of
* Ruby 1.8). If <i>options</i> is a <code>Fixnum</code>, it should be one or
* more of the constants <code>Regexp::EXTENDED</code>,
- * <code>Regexp::IGNORECASE</code>, and <code>Regexp::POSIXLINE</code>,
+ * <code>Regexp::IGNORECASE</code>, and <code>Regexp::MULTILINE</code>,
* <em>or</em>-ed together. Otherwise, if <i>options</i> is not
* <code>nil</code>, the regexp will be case insensitive. The <i>lang</i>
* parameter enables multibyte support for the regexp: `n', `N' = none, `e',
@@ -1801,11 +1802,12 @@ rb_reg_quote(str)
/*
* call-seq:
- * Regexp.escape(str) => new_str
- * Regexp.quote(str) => new_str
+ * Regexp.escape(str) => a_str
+ * Regexp.quote(str) => a_str
*
* Escapes any characters that would have special meaning in a regular
- * expression. For any string,
+ * expression. Returns a new escaped string, or self if no characters are
+ * escaped. For any string,
* <code>Regexp.escape(<i>str</i>)=~<i>str</i></code> will be true.
*
* Regexp.escape('\\*?{}.') #=> \\\\\*\?\{\}\.