Improved docs, fixed identation
authorNHOrus <jy6x2b32pie9@yahoo.com>
Sat, 17 Jun 2017 14:24:45 +0000 (17:24 +0300)
committerEric S. Raymond <esr@thyrsus.com>
Sat, 17 Jun 2017 15:09:55 +0000 (11:09 -0400)
advent.adoc
main.c
notes.adoc
saveresume.c

index c1075e61fd7ba08eba8e8701bc5a7fa8c5e3e1a6..d0fd29b09918b1c54f4af0dcdfe3a0bbc6a57970 100644 (file)
@@ -39,6 +39,8 @@ There have been no gameplay changes.
 
 -s:: Suppress Emacs-like line editing and command history.
 
+-r:: Restore game from specified file
+
 -o:: Old-style.  Restores original interface, no prompt or line editing.
 
 == BUGS ==
diff --git a/main.c b/main.c
index 706b2987db1e9eec58ffaf4996ec8762a214f0df..3a7c7db1d0131903a8015733c5763fc97cd02073 100644 (file)
--- a/main.c
+++ b/main.c
@@ -95,13 +95,13 @@ int main(int argc, char *argv[])
            editline = prompt = false;
            break;
        case 'r':
-        rfp = fopen(optarg, "r");
-        if (rfp == NULL)
-        fprintf(stderr,
-            "advent: can't open save file %s for read\n",
-            optarg);
-        signal(SIGINT, sig_handler);
-        break;
+           rfp = fopen(optarg, "r");
+           if (rfp == NULL)
+               fprintf(stderr,
+                       "advent: can't open save file %s for read\n",
+                       optarg);
+           signal(SIGINT, sig_handler);
+           break;
        case 's':
            editline = false;
            break;
index f1716baf8b4c0a5d924b7c44c4d9fc6de94d7b28..00a733a0e3dd76a5ada810bbf12e3171ac30a773 100644 (file)
@@ -73,8 +73,8 @@ necessarily pretty ugly by modern standards. Encryption and
 checksumming have been discarded - it's pointless to try
 tamper-proofing saves when everyone has the source code.
 
-A -r command-line option has been added. It is functionally equivalent 
-to RESTORE command, but faster.
+A -r command-line been added. When it is given (with a file
+path argument) it is functionally equivalent to RESTORE command.
 
 == Translation ==
 
index 676fa24c28e8320bef8bf831215e723c889bca60..015b4be88c383440aae845e04715ae2192007416 100644 (file)
@@ -93,14 +93,14 @@ int restore(FILE* fp){
     IGNORE(fread(&save, sizeof(struct save_t), 1, fp));
     fclose(fp);
     if (save.version != VRSION) {
-       SETPRM(1,save.version/10,MOD(save.version,10));
-       SETPRM(3,VRSION/10,MOD(VRSION,10));
-       RSPEAK(VERSION_SKEW);
+        SETPRM(1,save.version/10,MOD(save.version,10));
+        SETPRM(3,VRSION/10,MOD(VRSION,10));
+        RSPEAK(VERSION_SKEW);
     } else {
-       memcpy(&game, &save.game, sizeof(struct game_t));
-       OBJSND[BIRD] = save.bird;
-       OBJTXT[OYSTER] = save.bivalve;
-       game.zzword=RNDVOC(3,game.zzword);
+        memcpy(&game, &save.game, sizeof(struct game_t));
+        OBJSND[BIRD] = save.bird;
+        OBJTXT[OYSTER] = save.bivalve;
+        game.zzword=RNDVOC(3,game.zzword);
     }
     return GO_TOP;
 }