diff --git a/src/main.c b/src/main.c index 7e65624..df36682 100644 --- a/src/main.c +++ b/src/main.c @@ -467,8 +467,9 @@ main (int argc, char **argv) if (sys->latex) latexDone (sys); - /* transfer any scenario counting to the exit code */ - if (sys->switchScenario < 0) + /* Transfer any scenario counting to the exit code, + * assuming that there is no error. */ + if (exitcode != 1 && sys->switchScenario < 0) { exitcode = sys->countScenario; }