mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -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) +
|
char *realname = snewn(40 + strlen(savefile) +
|
||||||
strlen(savesuffix), char);
|
strlen(savesuffix), char);
|
||||||
sprintf(realname, "%s%d%s", savefile, i, savesuffix);
|
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");
|
ctx.fp = fopen(realname, "w");
|
||||||
if (!ctx.fp) {
|
if (!ctx.fp) {
|
||||||
fprintf(stderr, "%s: open: %s\n", realname,
|
fprintf(stderr, "%s: open: %s\n", realname,
|
||||||
|
Reference in New Issue
Block a user