diff options
author | Christoph Gysin <christoph.gysin@gmail.com> | 2015-11-25 15:45:50 +0200 |
---|---|---|
committer | Christoph Gysin <christoph.gysin@gmail.com> | 2015-11-25 15:48:27 +0200 |
commit | eeb7f5c0369b3f909fb924af2d9f5b7a2f9e10bf (patch) | |
tree | 4f1ca31c2810e25ab90371fe7dcc9f4f63943a67 | |
parent | 402c9f4bf0fab1228b757990b292eb7b83690dd6 (diff) | |
download | sway-eeb7f5c0369b3f909fb924af2d9f5b7a2f9e10bf.tar.xz |
config: print line number
-rw-r--r-- | sway/config.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sway/config.c b/sway/config.c index 13865058..539c493b 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; |