Skip to content

Commit

Permalink
Don't cascade error messages
Browse files Browse the repository at this point in the history
Once snek_abort is set, stop printing more messages as those are likely
a consequence of the first.

Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
keith-packard committed Mar 7, 2019
1 parent 3103147 commit 3b9bcc8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions snek-error.c
Expand Up @@ -38,6 +38,8 @@ snek_error_name(const char *format, ...)
va_list args;
char c;

if (snek_abort)
return SNEK_NULL;
snek_abort = true;
va_start(args, format);
fprintf(stderr, "%s:%d ", snek_file, snek_line);
Expand Down

0 comments on commit 3b9bcc8

Please sign in to comment.