aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cfg.c1
-rw-r--r--cmd-parse.y4
2 files changed, 3 insertions, 2 deletions
diff --git a/cfg.c b/cfg.c
index aa5c13b7..d6435980 100644
--- a/cfg.c
+++ b/cfg.c
@@ -126,6 +126,7 @@ load_cfg(const char *path, struct client *c, struct cmdq_item *item, int flags,
memset(&pi, 0, sizeof pi);
pi.flags = flags;
pi.file = path;
+ pi.line = 1;
pr = cmd_parse_from_file(f, &pi);
fclose(f);
diff --git a/cmd-parse.y b/cmd-parse.y
index e576d776..e9ca376c 100644
--- a/cmd-parse.y
+++ b/cmd-parse.y
@@ -356,7 +356,7 @@ command : assignment TOKEN
$$ = xcalloc(1, sizeof *$$);
$$->name = $2;
- $$->line = ps->input->line;
+ $$->line = ps->input->line - 1;
}
| assignment TOKEN arguments
@@ -365,7 +365,7 @@ command : assignment TOKEN
$$ = xcalloc(1, sizeof *$$);
$$->name = $2;
- $$->line = ps->input->line;
+ $$->line = ps->input->line - 1;
$$->argc = $3.argc;
$$->argv = $3.argv;