aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--file.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 57a4f1c752..9da09f7e6d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Mar 23 18:54:57 2009 Akinori MUSHA <knu@iDaemons.org>
+
+ * file.c (rb_file_s_stat, rb_file_s_lstat): Remove repeated type
+ checks.
+
Mon Mar 23 14:57:48 2009 Narihiro Nakamura <authorNari@gmail.com>
* gc.c (init_heap): set default to heap slots length
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);