diff options
| author | Simon Tatham <anakin@pobox.com> | 2012-12-28 11:22:13 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2012-12-28 11:22:13 +0000 |
| commit | 261a784d1ebbbaff5123c6cfc4b64c3dbe6a2046 (patch) | |
| tree | b1bc3492e4e3512aa6dc5762fc1d483ac65f2d03 | |
| parent | e17bf4abec88eba9511639e2495d6c1c35ad2311 (diff) | |
| download | puzzles-261a784d1ebbbaff5123c6cfc4b64c3dbe6a2046.zip puzzles-261a784d1ebbbaff5123c6cfc4b64c3dbe6a2046.tar.gz puzzles-261a784d1ebbbaff5123c6cfc4b64c3dbe6a2046.tar.bz2 puzzles-261a784d1ebbbaff5123c6cfc4b64c3dbe6a2046.tar.xz | |
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.
[originally from svn r9733]
| -rw-r--r-- | gtk.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -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); |