#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