From 3e5b0fcead2d21c727ff5779edc4d25ab84b48c6 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: http://svn.ruby-lang.org/repos/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 20c6e342f..12985ee48 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