aboutsummaryrefslogtreecommitdiffstats
path: root/eval_error.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-07 04:16:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-07 04:16:31 +0000
commit23a0a9b90daa9d550b1fdfe8f5827879122e7065 (patch)
tree643a5da92a8dfda77f49ecc4b7f661f77961d091 /eval_error.c
parentf39ea3d189063d8c6cf4fee9783a99ba4db87303 (diff)
downloadruby-23a0a9b90daa9d550b1fdfe8f5827879122e7065.tar.gz
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
Diffstat (limited to 'eval_error.c')
-rw-r--r--eval_error.c16
1 files changed, 8 insertions, 8 deletions
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