summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-12-31 05:26:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-12-31 05:26:24 +0000
commit64889f2e202e7e152fbff97183e7111bb0977688 (patch)
tree06f7ad586549dc663fadd74e12ed86acf9b1fef9 /parse.y
parent4487101681fe8597bb72cc1bed41a8a1f10a68bf (diff)
* 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/branches/ruby_1_6@1952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 3 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 6004eaf5a5..aa41474fce 100644
--- a/parse.y
+++ b/parse.y
@@ -1947,6 +1947,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;
@@ -2057,7 +2059,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