summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2023-04-10 15:23:44 +0900
committerNobuyoshi Nakada <[email protected]>2023-04-10 15:23:44 +0900
commitdc5f9387654a89ee18384ddec1bde5b44f7c238d ()
tree958068c3b3babc95aa7ca04e562979186c54fc8b
parentc30cab8ce4d2ab21ef75e2a3218cb76b21d78407 (diff)
Prefer `write_warn` over `write_warn2` with a string literal
Notes: Merged: https://.com/ruby/ruby/pull/7681
-rw-r--r--eval_error.c8
1 files changed, 4 insertions, 4 deletions
@@ -105,7 +105,7 @@ print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VA
if (highlight) write_warn(str, underline);
write_warn(str, "unhandled exception");
if (highlight) write_warn(str, reset);
- write_warn2(str, "\n", 1);
}
else {
VALUE epath;
@@ -176,18 +176,18 @@ rb_decorate_message(const VALUE eclass, const VALUE emesg, int highlight)
write_warn(str, reset);
write_warn(str, bold);
}
- write_warn2(str, ")", 1);
if (highlight) write_warn(str, reset);
}
if (tail && einfo+elen > tail) {
if (!highlight) {
- write_warn2(str, "\n", 1);
write_warn_enc(str, tail, einfo+elen-tail, eenc);
}
else {
elen -= tail - einfo;
einfo = tail;
- write_warn2(str, "\n", 1);
while (elen > 0) {
tail = memchr(einfo, '\n', elen);
if (!tail || tail > einfo) {