From: simon Date: Fri, 28 Dec 2012 11:22:13 +0000 (+0000) Subject: Actually do what the comment says at the top of main() regarding not X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/commitdiff_plain/68f53121c166df436ee586d2f96dc3148775de9a?hp=2fb439b45a8d445a24aee5b21fa10c33830a134a Actually do what the comment says at the top of main() regarding not bombing out due to an option that we don't recognise but GTK will. Somehow my basically workable plan had been completely nullified by putting the error check in the wrong place. git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9733 cda61777-01e9-0310-a592-d414129be87e --- 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);