aboutsummaryrefslogtreecommitdiff
path: root/sam.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-01-14 15:58:52 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-01-14 17:40:14 +0100
commite86abf9d634b7a0bc0e4d4f83ebe6ca4ee357833 (patch)
tree408380fcba8fac27ea983289e66ff80c5ee8697b /sam.c
parentda5a3152f073a59eb936aa9c7d03d648af087503 (diff)
downloadvis-e86abf9d634b7a0bc0e4d4f83ebe6ca4ee357833.tar.gz
vis-e86abf9d634b7a0bc0e4d4f83ebe6ca4ee357833.tar.xz
sam: do not clobber error value when failing to parse a group
When encountering a parsing error within a { } command group do not set the error cause to unmatched brace.
Diffstat (limited to 'sam.c')
-rw-r--r--sam.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sam.c b/sam.c
index af95c14..c7a9c48 100644
--- a/sam.c
+++ b/sam.c
@@ -828,6 +828,8 @@ static Command *command_parse(Vis *vis, const char **s, enum SamError *err) {
while (**s == ' ' || **s == '\t' || **s == '\n')
(*s)++;
next = command_parse(vis, s, err);
+ if (*err)
+ goto fail;
if (prev)
prev->next = next;
else