aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gtk.c b/gtk.c
index 714d679..4222bd4 100644
--- a/gtk.c
+++ b/gtk.c
@@ -2655,11 +2655,6 @@ int main(int argc, char **argv)
}
}
- if (*errbuf) {
- fputs(errbuf, stderr);
- return 1;
- }
-
/*
* Special standalone mode for generating puzzle IDs on the
* command line. Useful for generating puzzles to be printed
@@ -2687,6 +2682,16 @@ int main(int argc, char **argv)
char *id;
document *doc = NULL;
+ /*
+ * If we're in this branch, we should display any pending
+ * error message from the command line, since GTK isn't going
+ * to take another crack at making sense of it.
+ */
+ if (*errbuf) {
+ fputs(errbuf, stderr);
+ return 1;
+ }
+
n = ngenerate;
me = midend_new(NULL, &thegame, NULL, NULL);