summaryrefslogtreecommitdiffstats
path: root/cmd-parse.y
diff options
context:
space:
mode:
authornicm <nicm>2019-05-23 18:39:00 +0000
committernicm <nicm>2019-05-23 18:39:00 +0000
commitf3e01ecc42e34a914ee390658625e920d321734a (patch)
tree0ddaf2153c76df131932b80c71903d80f7dda656 /cmd-parse.y
parent6c260af56db8a71747c1dc51fe6bba2f51c47f4d (diff)
Fix line numbers - commands are added after the line ends so they need to
get line - 1.
Diffstat (limited to 'cmd-parse.y')
-rw-r--r--cmd-parse.y4
1 files changed, 2 insertions, 2 deletions
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;