mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Allow --save to work with --soln, causing saved game files to be
written out with the Solve operation having already been performed. [originally from svn r9375]
This commit is contained in:
10
gtk.c
10
gtk.c
@ -2698,6 +2698,16 @@ int main(int argc, char **argv)
|
||||
char *realname = snewn(40 + strlen(savefile) +
|
||||
strlen(savesuffix), char);
|
||||
sprintf(realname, "%s%d%s", savefile, i, savesuffix);
|
||||
|
||||
if (soln) {
|
||||
char *err = midend_solve(me);
|
||||
if (err) {
|
||||
fprintf(stderr, "%s: unable to show solution: %s\n",
|
||||
realname, err);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
ctx.fp = fopen(realname, "w");
|
||||
if (!ctx.fp) {
|
||||
fprintf(stderr, "%s: open: %s\n", realname,
|
||||
|
Reference in New Issue
Block a user