From faade803a5646aaa5112395bfcca9816d4208587 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Fri, 5 Jul 2013 18:32:46 +0200 Subject: [PATCH] Fix book creation Due to duplicate use of the same file pointer variable the game file would be closed before any games were read from it. --- backend.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend.c b/backend.c index 6d243d7..ca486ef 100644 --- a/backend.c +++ b/backend.c @@ -15253,7 +15253,7 @@ void CreateBookEvent () { ListGame * lg = (ListGame *) gameList.head; - FILE *f; + FILE *f, *g; int nItem; static int secondTime = FALSE; @@ -15262,8 +15262,8 @@ CreateBookEvent () return; } - if(!secondTime && (f = fopen(appData.polyglotBook, "r"))) { - fclose(f); + if(!secondTime && (g = fopen(appData.polyglotBook, "r"))) { + fclose(g); secondTime++; DisplayNote(_("Book file exists! Try again for overwrite.")); return; -- 1.7.0.4