diff options
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/variable.c b/variable.c index 6700ead280..a38bd8ea3c 100644 --- a/variable.c +++ b/variable.c @@ -716,14 +716,12 @@ rb_f_global_variables(void) { VALUE ary = rb_ary_new(); char buf[4]; - const char *s = "&`'+123456789"; + const char *s = "123456789"; st_foreach_safe(rb_global_tbl, gvar_i, ary); - if (!NIL_P(rb_backref_get())) { - while (*s) { - sprintf(buf, "$%c", *s++); - rb_ary_push(ary, rb_str_new2(buf)); - } + while (*s) { + sprintf(buf, "$%c", *s++); + rb_ary_push(ary, ID2SYM(rb_intern(buf))); } return ary; } |