From: H.G. Muller Date: Sun, 12 Jul 2009 01:22:17 +0000 (-0700) Subject: better handling of pasting a game without PGN tags X-Git-Tag: v4.4.0.beta1~31 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=5a2f62ac3fabf21ab669a67ef142fa9cd45b26a9;p=xboard.git better handling of pasting a game without PGN tags patch in wclipbrd.h to make it smarter to decide between pasting a game or a position so it can handle games without PGN tags. If it doesn't parse as a FEN it is assumed to be a game. --- diff --git a/winboard/wclipbrd.c b/winboard/wclipbrd.c index b187344..e3c677e 100644 --- a/winboard/wclipbrd.c +++ b/winboard/wclipbrd.c @@ -38,6 +38,7 @@ /* Imports from winboard.c */ extern HWND hwndMain; +Boolean ParseFEN(Board b, int *stm, char *FEN); /* File globals */ static char *copyTemp; @@ -291,18 +292,24 @@ PasteGameFromClipboard() VOID PasteGameOrFENFromClipboard() { char *buf; - char *tmp; +// char *tmp; + Board dummyBoard; int dummy; // [HGM] paste any if (!PasteTextFromClipboard(&buf)) { return; } +#if 0 tmp = buf; while( *tmp == ' ' || *tmp == '\t' || *tmp == '\r' || *tmp == '\n' ) { tmp++; } if( *tmp == '[' ) { +#else + // [HGM] paste any: make still smarter, to allow pasting of games without tags, recognize FEN in stead + if(!ParseFEN(dummyBoard, &dummy, buf) ) { +#endif PasteGameFromString( buf ); } else {