496 |
496 |
497 if (settings->continuepgn) { |
497 if (settings->continuepgn) { |
498 FILE *pgnfile = fopen(settings->continuepgn, "r"); |
498 FILE *pgnfile = fopen(settings->continuepgn, "r"); |
499 if (pgnfile) { |
499 if (pgnfile) { |
500 int result = read_pgn(pgnfile, &gamestate, &(settings->gameinfo)); |
500 int result = read_pgn(pgnfile, &gamestate, &(settings->gameinfo)); |
|
501 long position = ftell(pgnfile); |
501 fclose(pgnfile); |
502 fclose(pgnfile); |
502 if (result) { |
503 if (result) { |
503 addstr("Invalid PGN file content.\n"); |
504 printw("Invalid PGN file content at position %ld:\n%s\n", |
|
505 position, pgn_error_str(result)); |
504 return; |
506 return; |
505 } |
507 } |
506 if (!is_game_running(&gamestate)) { |
508 if (!is_game_running(&gamestate)) { |
507 addstr("Game has ended. Use -S to analyze it.\n"); |
509 addstr("Game has ended. Use -S to analyze it.\n"); |
508 return; |
510 return; |