From: H.G. Muller Date: Fri, 5 Jul 2013 16:32:46 +0000 (+0200) Subject: Fix book creation X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=faade803a5646aaa5112395bfcca9816d4208587;p=xboard.git 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. --- 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;