summaryrefslogtreecommitdiffstats
path: root/object.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-22 04:09:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-22 04:09:24 +0000
commitc1ea6b2de46dcd559df4d05b8f230c5a7f5c3f09 (patch)
tree91d0af7f1c0a88817d1d088b1010c891f8149301 /object.c
parente9950cd3e94ed8b8444eb6c600cb72af065c415e (diff)
downloadruby-c1ea6b2de46dcd559df4d05b8f230c5a7f5c3f09.tar.gz
ruby-c1ea6b2de46dcd559df4d05b8f230c5a7f5c3f09.tar.xz
ruby-c1ea6b2de46dcd559df4d05b8f230c5a7f5c3f09.zip
* object.c (sym_inspect), parse.y (parser_yylex, rb_symname_p): check
if valid as a symbol name more strictly. [ruby-dev:27478] * test/ruby/test_symbol.rb: tests for [ruby-core:03573]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/object.c b/object.c
index facdb5811..837e74cb9 100644
--- a/object.c
+++ b/object.c
@@ -1174,7 +1174,7 @@ sym_inspect(sym)
str = rb_str_new(0, strlen(name)+1);
RSTRING(str)->ptr[0] = ':';
strcpy(RSTRING(str)->ptr+1, name);
- if (rb_is_junk_id(id)) {
+ if (!rb_symname_p(name)) {
str = rb_str_dump(str);
strncpy(RSTRING(str)->ptr, ":\"", 2);
}