diff options
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/shell.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/shell/shell.c b/shell/shell.c index 1ef1a39..2a2720f 100644 --- a/shell/shell.c +++ b/shell/shell.c | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | #include <inttypes.h> | 1 | #include <inttypes.h> |
| 2 | #include <limits.h> | ||
| 2 | #include <errno.h> | 3 | #include <errno.h> |
| 3 | #include <stdarg.h> | 4 | #include <stdarg.h> |
| 4 | #include <stdbool.h> | 5 | #include <stdbool.h> |
| @@ -482,6 +483,9 @@ solve_exec(args_t *args) | |||
| 482 | return -1; | 483 | return -1; |
| 483 | } | 484 | } |
| 484 | 485 | ||
| 486 | if (args->maxsolutions == 0) | ||
| 487 | args->maxsolutions = args->optimal >= 0 ? UINT_MAX : 1; | ||
| 488 | |||
| 485 | buf = malloc(size); | 489 | buf = malloc(size); |
| 486 | read = fread(buf, size, 1, file); | 490 | read = fread(buf, size, 1, file); |
| 487 | fclose(file); | 491 | fclose(file); |
| @@ -578,8 +582,8 @@ parse_args(int argc, char **argv, args_t *args) | |||
| 578 | .str_nisstype = "", | 582 | .str_nisstype = "", |
| 579 | .minmoves = 0, | 583 | .minmoves = 0, |
| 580 | .maxmoves = 20, | 584 | .maxmoves = 20, |
| 581 | .optimal = -1, | 585 | .optimal = 20, |
| 582 | .maxsolutions = 1, | 586 | .maxsolutions = 0, |
| 583 | .threads = 0, | 587 | .threads = 0, |
| 584 | }; | 588 | }; |
| 585 | 589 | ||
