From 5a2f62ac3fabf21ab669a67ef142fa9cd45b26a9 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sat, 11 Jul 2009 18:22:17 -0700 Subject: [PATCH] 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. --- winboard/wclipbrd.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) 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 { -- 1.7.0.4