From be458259da8b3e2623e426fd3354690e01da7a90 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 16 Mar 2005 09:26:38 +0000 Subject: * 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 --- object.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'object.c') 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); } -- cgit v1.2.3