summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-04 07:28:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-04 07:28:35 +0000
commit47732dbd2ba2430c22d10663399a42447e98b240 (patch)
tree58b056860aa6493e8bee96c21124dc717ad3f57a /parse.y
parent0f09f59ef7ae5179936c48311574f5607034ef43 (diff)
* parse.y (reg_compile_gen): copy encoding from source string if
non-empty. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index b81e37ee0f..3b4065ac06 100644
--- a/parse.y
+++ b/parse.y
@@ -8170,7 +8170,7 @@ reg_compile_gen(struct parser_params* parser, VALUE str, int options)
compile_error(PARSER_ARG "%s", RSTRING_PTR(re));
return Qnil;
}
- rb_enc_copy(re, str);
+ if (str) rb_enc_copy(re, str);
return re;
}