* re.c (rb_reg_desc): re might be NULL.

* regerror.c (onig_error_code_to_format): message updated.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-11-18 06:51:19 +00:00
parent ad5ff1c237
commit 4ccfa1e9f8
3 changed files with 8 additions and 2 deletions

2
re.c
View file

@ -380,7 +380,7 @@ static VALUE
rb_reg_desc(const char *s, long len, VALUE re)
{
VALUE str = rb_str_buf_new2("/");
if (rb_enc_asciicompat(rb_enc_get(re))) {
if (re && rb_enc_asciicompat(rb_enc_get(re))) {
rb_enc_copy(str, re);
}
else {