From eeb7f5c0369b3f909fb924af2d9f5b7a2f9e10bf Mon Sep 17 00:00:00 2001 From: Christoph Gysin Date: Wed, 25 Nov 2015 15:45:50 +0200 Subject: [PATCH] config: print line number --- sway/config.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sway/config.c b/sway/config.c index 138650587..539c493b2 100644 --- a/sway/config.c +++ b/sway/config.c @@ -231,15 +231,18 @@ bool read_config(FILE *file, bool is_active) { bool success = true; enum cmd_status block = CMD_BLOCK_END; + int line_number = 0; char *line; while (!feof(file)) { line = read_line(file); + line_number++; line = strip_comments(line); struct cmd_results *res = config_command(line); switch(res->status) { case CMD_FAILURE: case CMD_INVALID: - sway_log(L_ERROR, "Error on line '%s': %s", line, res->error); + sway_log(L_ERROR, "Error on line %i '%s': %s", line_number, line, + res->error); success = false; break;