updated year in copyright info
[xboard.git] / winboard / wclipbrd.c
index b9514bb..cb4b5f1 100644 (file)
@@ -1,7 +1,7 @@
 /*\r
  * wclipbrd.c -- Clipboard routines for WinBoard\r
  *\r
- * Copyright 2000,2009 Free Software Foundation, Inc.\r
+ * Copyright 2000, 2009, 2010 Free Software Foundation, Inc.\r
  *\r
  * Enhancements Copyright 2005 Alessandro Scotti\r
  *\r
@@ -32,9 +32,9 @@
 #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
@@ -50,6 +50,7 @@ CopyFENToClipboard()
 {\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
@@ -349,15 +350,11 @@ PasteTextFromClipboard(char **text)
     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