summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/eval.c b/eval.c
index 504a31c062..42a38b6417 100644
--- a/eval.c
+++ b/eval.c
@@ -4896,9 +4896,8 @@ rb_f_require(obj, fname)
buf = ALLOCA_N(char, strlen(RSTRING(fname)->ptr) + 5);
strcpy(buf, RSTRING(fname)->ptr);
strcat(buf, ".rb");
- file = find_file(buf);
- if (file) {
- fname = rb_str_new2(file);
+ if (find_file(buf)) {
+ fname = rb_str_new2(buf);
feature = buf;
goto load_rb;
}