diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-12-31 05:26:24 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-12-31 05:26:24 +0000 |
commit | c8911896936224415bc120b2996a347d5f7f6ba5 (patch) | |
tree | 5cf9ae2463d30f80bcce7da43143b33fbc509cc6 /parse.y | |
parent | f3d9a0cc213f8b09155f063e057afb576178557e (diff) | |
download | ruby-c8911896936224415bc120b2996a347d5f7f6ba5.tar.gz |
* parse.y (yycompile): always store copy of filename.
* parse.y (rb_compile_file): no longer need to strdup() here.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2118,6 +2118,8 @@ yycompile(f, line) int n; NODE *node = 0; + f = strdup(f); + if (!compile_for_eval && rb_safe_level() == 0 && rb_const_defined(rb_cObject, rb_intern("SCRIPT_LINES__"))) { VALUE hash, fname; @@ -2228,7 +2230,7 @@ rb_compile_file(f, file, start) lex_pbeg = lex_p = lex_pend = 0; ruby_sourceline = start - 1; - return yycompile(strdup(f), start); + return yycompile(f, start); } static inline int |