]> git.cameronkatri.com Git - bsdgames-darwin.git/commitdiff
make the code agree with documentation and usage() for final two
authorphil <phil@NetBSD.org>
Thu, 29 Dec 1994 08:00:17 +0000 (08:00 +0000)
committerphil <phil@NetBSD.org>
Thu, 29 Dec 1994 08:00:17 +0000 (08:00 +0000)
options.

boggle/boggle/bog.c

index c3ca5474e53b504d34009b96f400311c1ecb8adf..44bbea02a204480193a60e61d64e154704468df0 100644 (file)
@@ -155,21 +155,29 @@ main(argc, argv)
        argc -= optind;
        argv += optind;
 
-       /* process boardspec if given */
+       /* process final arguments */
        if (argc > 0)
                if (strcmp(argv[0], "+") == 0)
                        reuse = 1;
                else if (strcmp(argv[0], "++") == 0)
                        selfuse = 1;
-               else if (islower(argv[0][0])) {
+
+       if (reuse || selfuse) {
+               argc -= 1;
+               argv += 1;
+       }
+
+       if (argc > 0)
+               if (islower(argv[0][0])) {
                        if (strlen(argv[0]) != 16) {
                                usage();
-
+                       } else {
                                /* This board is assumed to be valid... */
                                bspec = argv[0];
-                       } else
-                               usage();
-                       }
+                       }
+               } else {
+                       usage();
+               }
 
        if (batch && bspec == NULL)
                errx(1, "must give both -b and a board setup");