Remove debug printf for kanji
[xboard.git] / parser.c
index c997ccd..4acdfae 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -180,7 +180,6 @@ GetKanji (char **p, int start)
     int i;
 
     if((*q & 0x80) == 0) return 0; // plain ASCII, refuse to parse
-fprintf(debugFP, "kanji %03o %03o\n", *q, q[1]);
     if((**p & 0xC0) == 0x80) { // this is an illegal starting code in utf-8, so assume shift-JIS
        for(i=start+JIS; kanjiTab[i]; i+=4) {
            if(q[0] == kanjiTab[i+1] && q[1] == kanjiTab[i+2]) {
@@ -675,7 +674,12 @@ badMove:// we failed to find algebraic move
            commentEnd = *p; if(i) return Comment; // return comment that runs to EOF immediately
        }
         if(commentEnd) SkipWhite(p);
-       if(lastChar == '\n' && kifu && **p == '*') { while(**p && **p != '\n') (*p)++; return Comment; } // .kif comment
+       if(kifu && **p == '*') { // .kif comment
+           char *q = yytext;
+           while(**p && **p != '\n') { if(q < yytext + 10*MSG_SIZ-3) *q++ = **p; (*p)++; }
+           parseStart = yytext; *yytext = '{'; strcpy(q, "}\n"); // wrap in braces
+           return Comment;
+       }
        if(Match("*", p)) result = GameUnfinished;
        else if(**p == '0') {
            if( Match("0-1", p) || Match("0/1", p) || Match("0:1", p) ||