summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-31 09:11:12 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-31 09:11:12 +0000
commite13e58bef695d094665068e73f322e639505635f (patch)
tree042e8fe2dd5aa94173af46a30d8a258b9e3ccb53 /parse.y
parent38df1a90cc68d132306c9484ed57faa0be656b0e (diff)
* parse.y (rb_intern): should handle multibyte name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3890 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 c9ef893..c5f5d8c 100644
--- a/parse.y
+++ b/parse.y
@@ -5781,6 +5781,7 @@ rb_intern(name)
if (st_lookup(sym_tbl, (st_data_t)name, (st_data_t *)&id))
return id;
+ last = strlen(name)-1;
id = 0;
switch (*name) {
case '$':
@@ -5812,7 +5813,6 @@ rb_intern(name)
}
}
- last = strlen(name)-1;
if (name[last] == '=') {
/* attribute assignment */
char *buf = ALLOCA_N(char,last+1);
@@ -5835,7 +5835,7 @@ rb_intern(name)
break;
}
while (*m && is_identchar(*m)) {
- m++;
+ m += mblen(m, name + last - m + 1);
}
if (*m) id = ID_JUNK;
id |= ++last_id << ID_SCOPE_SHIFT;