diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-14 07:25:56 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-14 07:25:56 +0000 |
| commit | d43bfa2211e21355b65889118d7bac9284557900 (patch) | |
| tree | ab726f463981a1effe9690b4b6236cb083b2791f /object.c | |
| parent | e4abff20447bfaae24de292ca8cadb3dff461f22 (diff) | |
| download | ruby-d43bfa2211e21355b65889118d7bac9284557900.tar.gz ruby-d43bfa2211e21355b65889118d7bac9284557900.tar.xz ruby-d43bfa2211e21355b65889118d7bac9284557900.zip | |
* string.c (rb_str_intern): raise SecurityError only when $SAFE
level is greater than zero. [ruby-core:08862]
* parse.y (rb_interned_p): new function to check if a string is
already interned.
* object.c (str_to_id): use rb_str_intern().
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
| -rw-r--r-- | object.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -1606,13 +1606,9 @@ static ID str_to_id(str) VALUE str; { - if (!RSTRING(str)->ptr || RSTRING(str)->len == 0) { - rb_raise(rb_eArgError, "empty symbol string"); - } - if (RSTRING(str)->len != strlen(RSTRING(str)->ptr)) { - rb_warn("Symbols should not contain NUL (\\0)"); - } - return rb_intern(RSTRING(str)->ptr); + VALUE sym = rb_str_intern(str); + + return SYM2ID(sym); } ID |
