summaryrefslogtreecommitdiff
path: root/object.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 /object.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 'object.c')
-rw-r--r--object.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/object.c b/object.c
index 20c6e342fa..12985ee481 100644
--- a/object.c
+++ b/object.c
@@ -1643,6 +1643,9 @@ str_to_id(str)
if (!RSTRING(str)->ptr || RSTRING(str)->len == 0) {
rb_raise(rb_eArgError, "empty symbol string");
}
+ if (RSTRING(str)->len != strlen(RSTRING(str)->ptr)) {
+ warn("Symbols should not contain NUL (\\0)");
+ }
return rb_intern(RSTRING(str)->ptr);
}