summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-06-03 13:21:20 -0400
committerTavian Barnes <tavianator@tavianator.com>2017-06-03 14:45:48 -0400
commita6c25c7c74f762cb40639da0b9b98bfcf3f4c590 (patch)
tree0ab35020876133cb03c43ff5b193dc893972e0b4
parentcc71aecdfbb00a35d9094038c3ef559968d11c19 (diff)
downloadbfs-a6c25c7c74f762cb40639da0b9b98bfcf3f4c590.tar.xz
parse: Make some error messages red
-rw-r--r--parse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse.c b/parse.c
index 18d4c42..ed7685b 100644
--- a/parse.c
+++ b/parse.c
@@ -2416,13 +2416,15 @@ static struct expr *new_not_expr(const struct parser_state *state, struct expr *
* | LITERAL
*/
static struct expr *parse_factor(struct parser_state *state) {
+ CFILE *cerr = state->cmdline->cerr;
+
if (skip_paths(state) != 0) {
return NULL;
}
const char *arg = state->argv[0];
if (!arg) {
- fputs("Expression terminated prematurely.\n", stderr);
+ cfprintf(cerr, "%{er}error: Expression terminated prematurely after '%s'.%{rs}\n", state->argv[-1]);
return NULL;
}
@@ -2441,7 +2443,7 @@ static struct expr *parse_factor(struct parser_state *state) {
arg = state->argv[0];
if (!arg || strcmp(arg, ")") != 0) {
- fputs("Expected a ')'.\n", stderr);
+ cfprintf(cerr, "%{er}error: Expected a ')' after '%s'.%{rs}\n", state->argv[-1]);
free_expr(expr);
return NULL;
}