aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/file.c b/file.c
index 3a9472add8..1107f8bd05 100644
--- a/file.c
+++ b/file.c
@@ -777,7 +777,6 @@ rb_file_s_stat(VALUE klass, VALUE fname)
rb_secure(4);
FilePathValue(fname);
if (rb_stat(fname, &st) < 0) {
- FilePathValue(fname);
rb_sys_fail(RSTRING_PTR(fname));
}
return stat_new(&st);
@@ -834,7 +833,7 @@ rb_file_s_lstat(VALUE klass, VALUE fname)
rb_secure(2);
FilePathValue(fname);
- if (lstat(StringValueCStr(fname), &st) == -1) {
+ if (lstat(fname, &st) == -1) {
rb_sys_fail(RSTRING_PTR(fname));
}
return stat_new(&st);