summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-21 14:16:00 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-21 14:16:00 +0000
commit967cca2f8d13c113461f26879d501b03cfeec6c0 (patch)
treed093f11df7682c60dcd8108340f2f02c3a634dcc /parse.y
parent5a164c1891600cd20fadbda4f173b8a578f95126 (diff)
* parse.y (rb_intern2): ID_JUNK test based on len, not by NUL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 70c57ac796..c2ca84ce3f 100644
--- a/parse.y
+++ b/parse.y
@@ -8420,8 +8420,8 @@ rb_symname_p(const char *name)
ID
rb_intern2(const char *name, long len)
{
+ const char *m = name;
VALUE str = rb_str_new(name, len);
- const char *m = RSTRING_PTR(str);
ID id;
int last;
@@ -8481,7 +8481,7 @@ rb_intern2(const char *name, long len)
m += mbclen(*m);
}
}
- if (*m) id = ID_JUNK;
+ if (m - name < len) id = ID_JUNK;
new_id:
id |= ++global_symbols.last_id << ID_SCOPE_SHIFT;
id_register: