#include <sys/stat.h>\r
\r
#include "common.h"\r
-#include "winboard.h"\r
#include "frontend.h"\r
#include "backend.h"\r
+#include "winboard.h"\r
#include "wclipbrd.h"\r
\r
/* Imports from winboard.c */\r
{\r
char *fen = NULL;\r
\r
+ if(gameMode == EditPosition) EditPositionDone(TRUE); // [HGM] mak sure castling rights are set consistently\r
fen = PositionToFEN(currentMove, NULL);\r
if (!fen) {\r
DisplayError("Unable to convert position to FEN.", 0);\r
return;\r
}\r
\r
-#if 0\r
- tmp = buf;\r
- while( *tmp == ' ' || *tmp == '\t' || *tmp == '\r' || *tmp == '\n' ) {\r
- tmp++;\r
- }\r
-\r
- if( *tmp == '[' ) {\r
-#else\r
// [HGM] paste any: make still smarter, to allow pasting of games without tags, recognize FEN in stead\r
if(!ParseFEN(dummyBoard, &dummy, buf) ) {\r
-#endif\r
PasteGameFromString( buf );\r
}\r
else {\r
fprintf(debugFP, "PasteTextFromClipboard(): lock count %d\n", lockCount);\r
}\r
SetLastError(NO_ERROR);\r
-#if 1\r
/*suggested by Wilkin Ng*/\r
lockCount = GlobalFlags(hClipMem) & GMEM_LOCKCOUNT;\r
if (lockCount) {\r
locked = GlobalUnlock(hClipMem);\r
}\r
-#else\r
- locked = GlobalUnlock(hClipMem);\r
-#endif\r
err = GetLastError();\r
if (appData.debugMode) {\r
lockCount = GlobalFlags(hClipMem) & GMEM_LOCKCOUNT;\r