aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Gysin <christoph.gysin@gmail.com>2015-11-25 15:45:50 +0200
committerChristoph Gysin <christoph.gysin@gmail.com>2015-11-25 15:48:27 +0200
commiteeb7f5c0369b3f909fb924af2d9f5b7a2f9e10bf (patch)
tree4f1ca31c2810e25ab90371fe7dcc9f4f63943a67
parent402c9f4bf0fab1228b757990b292eb7b83690dd6 (diff)
downloadsway-eeb7f5c0369b3f909fb924af2d9f5b7a2f9e10bf.tar.xz
config: print line number
-rw-r--r--sway/config.c5
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;