mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-io (mrb_file_realpath): use mrb_str_cat instead of mrb_str_append
This commit is contained in:
@@ -279,10 +279,10 @@ static mrb_value
|
||||
mrb_file_realpath(mrb_state *mrb, mrb_value klass)
|
||||
{
|
||||
mrb_value pathname, dir_string;
|
||||
mrb_int argc = mrb_get_args(mrb, "S|S", &pathname, &dir_string);
|
||||
if (argc == 2) {
|
||||
|
||||
if (mrb_get_args(mrb, "S|S", &pathname, &dir_string) == 2) {
|
||||
mrb_value s = mrb_str_dup(mrb, dir_string);
|
||||
s = mrb_str_append(mrb, s, mrb_str_new_cstr(mrb, FILE_SEPARATOR));
|
||||
s = mrb_str_cat_cstr(mrb, s, FILE_SEPARATOR);
|
||||
s = mrb_str_append(mrb, s, pathname);
|
||||
pathname = s;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user