diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-03-28 08:43:25 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-03-28 08:43:25 +0000 |
| commit | 3b947661aa91f7c8291f681dd1d26f79ea562d24 (patch) | |
| tree | 3f1464728d4c6d3ba1e64bbe22e1f00672a8690a /object.c | |
| parent | ebedbeadb00f23e64f88c249b0603223c09f8fbe (diff) | |
| download | ruby-3b947661aa91f7c8291f681dd1d26f79ea562d24.tar.gz ruby-3b947661aa91f7c8291f681dd1d26f79ea562d24.tar.xz ruby-3b947661aa91f7c8291f681dd1d26f79ea562d24.zip | |
* object.c (rb_str2cstr): warn if string contains \0 and length
value is ignored.
* class.c (rb_singleton_class_clone): should copy class constant
table as well.
* class.c (rb_include_module): sometimes cache was mistakenly left
uncleared - based on the patch by K.Kosako.
* ruby.h: all Check_SafeStr()'s are replaced by SafeStr() to
ensure 'to_str' be always effective.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
| -rw-r--r-- | object.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1058,6 +1058,9 @@ rb_str2cstr(str, len) str = rb_str_to_str(str); } if (len) *len = RSTRING(str)->len; + else if (ruby_verbose && RSTRING(str)->len != strlen(RSTRING(str)->ptr)) { + rb_warn("string contains \\0 character"); + } return RSTRING(str)->ptr; } |
