From 23a0a9b90daa9d550b1fdfe8f5827879122e7065 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 7 Jan 2018 04:16:31 +0000 Subject: eval_error.c: renamed an argument * eval_error.c (print_errinfo): renamed argument `colored` as `highlight`, as it does not use colors. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval_error.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'eval_error.c') diff --git a/eval_error.c b/eval_error.c index 0d3e8b3662..b6e0b99bd9 100644 --- a/eval_error.c +++ b/eval_error.c @@ -86,7 +86,7 @@ error_print(rb_execution_context_t *ec) } static void -print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VALUE str, int colored) +print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VALUE str, int highlight) { static const char underline[] = "\033[4;1m"; static const char bold[] = "\033[1m"; @@ -105,7 +105,7 @@ print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VA write_warn(str, ": "); } - if (colored) write_warn(str, bold); + if (highlight) write_warn(str, bold); if (!NIL_P(emesg)) { einfo = RSTRING_PTR(emesg); @@ -114,7 +114,7 @@ print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VA } if (eclass == rb_eRuntimeError && elen == 0) { - if (colored) write_warn(str, underline); + if (highlight) write_warn(str, underline); write_warn(str, "unhandled exception\n"); } else { @@ -122,7 +122,7 @@ print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VA epath = rb_class_name(eclass); if (elen == 0) { - if (colored) write_warn(str, underline); + if (highlight) write_warn(str, underline); write_warn_str(str, epath); write_warn(str, "\n"); } @@ -139,10 +139,10 @@ print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VA write_warn_str(str, tail ? rb_str_subseq(emesg, 0, len) : emesg); if (epath) { write_warn(str, " ("); - if (colored) write_warn(str, underline); + if (highlight) write_warn(str, underline); write_warn_str(str, epath); - if (colored) write_warn(str, reset); - if (colored) write_warn(str, bold); + if (highlight) write_warn(str, reset); + if (highlight) write_warn(str, bold); write_warn(str, ")\n"); } if (tail) { @@ -151,7 +151,7 @@ print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VA if (tail ? einfo[elen-1] != '\n' : !epath) write_warn2(str, "\n", 1); } } - if (colored) write_warn(str, reset); + if (highlight) write_warn(str, reset); } static void -- cgit v1.2.3