fix casting rights after FEN pasting
[xboard.git] / winboard / wclipbrd.c
index 6f546a4..f13e77f 100644 (file)
@@ -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