Commit 14e1992e authored by Akira Yumiyama's avatar Akira Yumiyama

add null check

parent d39a05e6
...@@ -250,6 +250,10 @@ mrb_file__gethome(mrb_state *mrb, mrb_value klass) ...@@ -250,6 +250,10 @@ mrb_file__gethome(mrb_state *mrb, mrb_value klass)
} }
} }
if (home == NULL) {
return mrb_nil_value();
}
if (!mrb_file_is_absolute_path(home)) { if (!mrb_file_is_absolute_path(home)) {
if (argc && strlen(cuser) > 0) { if (argc && strlen(cuser) > 0) {
mrb_raisef(mrb, E_ARGUMENT_ERROR, "non-absolute home of ~%s", cuser); mrb_raisef(mrb, E_ARGUMENT_ERROR, "non-absolute home of ~%s", cuser);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment