Resume from file on startup

This commit is contained in:
NHOrus 2017-06-16 19:44:23 +03:00
parent 51a88bec4d
commit 300d246179
4 changed files with 27 additions and 6 deletions

View file

@ -86,6 +86,10 @@ int resume(FILE *input)
linenoiseFree(name);
}
return restore(fp);
}
int restore(FILE* fp){
IGNORE(fread(&save, sizeof(struct save_t), 1, fp));
fclose(fp);
if (save.version != VRSION) {
@ -101,4 +105,4 @@ int resume(FILE *input)
return GO_TOP;
}
/* end */
/* end */