diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-11-25 09:09:05 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-11-25 09:09:05 -0500 |
commit | 964b4d2ddb212421062524eb007bcd199de277bc (patch) | |
tree | 396f0e8aba2d3441ccf2e56302798cf7514807d7 /sway | |
parent | 0976bf7f683a03e615d95896803ba79871584f22 (diff) | |
parent | eeb7f5c0369b3f909fb924af2d9f5b7a2f9e10bf (diff) |
Merge pull request #259 from christophgysin/lineno
config: print line number
Diffstat (limited to 'sway')
-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; |