summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-09 09:30:25 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-09 09:30:25 +0000
commite32da15f48189cfba02a9be2e6572161d91b3122 (patch)
tree47c660015f96f23220975c71fd69e71f8a69b6ef /eval.c
parent8673eacafa039f056927e0f91ce195afae9b9019 (diff)
1.1b9_09 pre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/eval.c b/eval.c
index 412f0b9db9..ed9af3c677 100644
--- a/eval.c
+++ b/eval.c
@@ -3831,17 +3831,21 @@ f_eval(argc, argv, self)
VALUE *argv;
VALUE self;
{
- VALUE src, scope, vfile, line;
+ VALUE src, scope, vfile, vline;
char *file = "(eval)";
+ int line = 0;
- rb_scan_args(argc, argv, "13", &src, &scope, &vfile, &line);
+ rb_scan_args(argc, argv, "13", &src, &scope, &vfile, &vline);
if (!NIL_P(vfile)) {
Check_Type(vfile, T_STRING);
file = RSTRING(vfile)->ptr;
}
+ if (!NIL_P(vline)) {
+ line = NUM2INT(vline);
+ }
Check_SafeStr(src);
- return eval(self, src, scope, file, NUM2INT(line));
+ return eval(self, src, scope, file, line);
}
static VALUE