From 84a4d340a6eaafed257548a0d2426c8facb711dd Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sun, 26 Feb 2023 18:40:45 +0900 Subject: [PATCH] mruby-io/file.c (_mtime): return nil instead of false As a Ruby convention, a method should return nil (not false) for the exceptional value, e.g. String#index. File#_mtime should follow the convention too. --- mrbgems/mruby-io/src/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mrbgems/mruby-io/src/file.c b/mrbgems/mruby-io/src/file.c index e0957ffa6..6505f9800 100644 --- a/mrbgems/mruby-io/src/file.c +++ b/mrbgems/mruby-io/src/file.c @@ -398,7 +398,7 @@ mrb_file_mtime(mrb_state *mrb, mrb_value self) mrb_stat st; if (mrb_fstat(fd, &st) == -1) - return mrb_false_value(); + return mrb_nil_value(); return mrb_int_value(mrb, (mrb_int)st.st_mtime); }