Merge pull request #604 from skandhas/pr-fix-check_iv_name

fix incorrect checkups in check_iv_name
This commit is contained in:
Yukihiro "Matz" Matsumoto
2012-12-09 21:45:01 -08:00
+1 -1
View File
@@ -564,7 +564,7 @@ check_iv_name(mrb_state *mrb, mrb_sym id)
int len;
s = mrb_sym2name_len(mrb, id, &len);
if (len < 2 || s[0] != '@') {
if (len < 2 || !(s[0] == '@' && s[1] != '@')) {
mrb_name_error(mrb, id, "`%s' is not allowed as an instance variable name", s);
}
}