diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-03-16 09:26:38 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-03-16 09:26:38 +0000 |
| commit | 3e5b0fcead2d21c727ff5779edc4d25ab84b48c6 (patch) | |
| tree | 10d8ceb3eed3fc1946701e631ccf16102d777c1c /re.c | |
| parent | 2d528523f4c7bacb1a92d1dff8fa830d2e9a031e (diff) | |
| download | ruby-3e5b0fcead2d21c727ff5779edc4d25ab84b48c6.tar.gz ruby-3e5b0fcead2d21c727ff5779edc4d25ab84b48c6.tar.xz ruby-3e5b0fcead2d21c727ff5779edc4d25ab84b48c6.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
| -rw-r--r-- | re.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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('\\*?{}.') #=> \\\\\*\?\{\}\. |
