Wed, 29 Apr 2026 17:41:00 +0200
prettier line breaking in exported PGNs
resolves #836
| src/chess/pgn.c | file | annotate | diff | comparison | revisions |
--- a/src/chess/pgn.c Wed Apr 29 17:28:03 2026 +0200 +++ b/src/chess/pgn.c Wed Apr 29 17:41:00 2026 +0200 @@ -184,6 +184,10 @@ size_t last_space_pos = 0; size_t line_len = 0; while (block[pos] != '\0') { + if (block[pos] == 0x1f) { + block[pos++] = ' '; + continue; + } if (block[pos] == ' ') { last_space_pos = pos; } @@ -243,7 +247,7 @@ int snpr; /* return value of printf calls */ if (i % 2 == 0) { - snpr = snprintf(moveblkptr, 16, "%d. %s", + snpr = snprintf(moveblkptr, 16, "%d.\x1f%s", 1+i/2, gamestate->moves[i].string); } else { snpr = snprintf(moveblkptr, 16, "%s",