FMSLogo includes carriage return characters at the end of a line when reading multi-line text from the clipboard. It does not do this for normal files.
This seems to be a regression introduced by the wxWidgets port. It is not reproducible in MSWLogo 6.5b or the OWL version of FMSLogo 6.35.0. It is reproducible in the wxWidgets version of FMSLogo 6.35.0.
How Reproducible:
Every Time
Steps to Reproduce:
1) Load the following procedure
TO PrintClipboard
LOCAL [line1]
OPENREAD "clipboard
SETREAD "clipboard
MAKE "line1 READWORD
SETREAD []
CLOSE "clipboard
PRINT :line1
PRINT COUNT :line1
END
2) Copy the following text onto the clipboard.
A
B
C
3) Run PrintClipboard
What Happens:
FMSLogo prints
A
2
This indicates that the carriage return from the first line was included in the result.
Expected Result:
FMSLogo prints
A
1
Note: If you keep running PrintClipboard, more carriage returns are added after the "A" and the number of character increases by one. This is partly due to this bug and partly due to Bug #528.
This is fixed by [r4942]. The fix will be available in FMSLogo 7.6.0.
I'm not sure how MSWLogo worked, but I suspect that Borland's C library converted \n to \r\n when files were opened for text, but did NOT modify \r\n, whereas the MingGW's libc converts all \n to \r\n, so if you write \r\n, it becomes \r\r\n. The corruption was the doubling of the \r characters.
My fix was to copy to/from the clipboard in binary mode, which preserves the \r\n.
Related
Commit: [r4942]