prettier line breaking in exported PGNs default tip

Wed, 29 Apr 2026 17:41:00 +0200

author
Mike Becker <universe@uap-core.de>
date
Wed, 29 Apr 2026 17:41:00 +0200
changeset 118
0f2ffbc408ce
parent 117
ee539a9691f0

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",

mercurial