Skip to content

Commit

Permalink
Add newline in Kernel.abort
Browse files Browse the repository at this point in the history
`abort('foo')` now adds a newline, `abort("foo\n")` does not add an
extra one.
This makes the behaviour consistent with MRI.
  • Loading branch information
herwinw committed Nov 5, 2024
1 parent ee9fffc commit ee491b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/kernel_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Value KernelModule::abort_method(Env *env, Value message) {
exception = SystemExit.send(env, "new"_s, { Value::integer(1), message })->as_exception();

auto out = env->global_get("$stderr"_s);
out->send(env, "write"_s, { message });
out->send(env, "puts"_s, { message });
} else {
exception = SystemExit.send(env, "new"_s, { Value::integer(1) })->as_exception();
}
Expand Down

0 comments on commit ee491b1

Please sign in to comment.