X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=saveresume.c;h=15d14c1472dbbdc09b784581ee30f9e3c9fd1d80;hb=83780631983a2eb5dc0e6d8789bedb67de985870;hp=ab2e1fed3ad67e57457f5e44acc16cd474113d9f;hpb=b2b4377f71d78cae58bc2e3ee8a9b61cecda9325;p=open-adventure.git diff --git a/saveresume.c b/saveresume.c index ab2e1fe..15d14c1 100644 --- a/saveresume.c +++ b/saveresume.c @@ -18,7 +18,14 @@ #include "advent.h" #include "dungeon.h" -#define VRSION 29 /* bump on save format change */ +/* + * Bump on save format change. + * + * Note: Verify that the tests run clean before bumping this, then rebuild the check + * files afterwards. Otherwise you will get a spurious failure due to the old version + * having been generated into a check file. + */ +#define VRSION 29 /* * If you change the first three members, the resume function may not properly @@ -101,6 +108,9 @@ int resume(void) while (fp == NULL) { char* name = readline("\nFile name: "); + // Autocomplete can leave the input with an extra traoling space. + if (name != NULL && strlen(name) > 0 && name[strlen(name) - 1] == ' ') + name[strlen(name) - 1] = '\0'; if (name == NULL) return GO_TOP; fp = fopen(name, READ_MODE);