Copied from discussion at https://sourceforge.net/p/toolshed/discussion/22367/thread/b7e4084c36/
Today I noticed that one of my text files has the last 229 lines double-spaced when using "os9 copy" to copy a Windows text file to an OS-9 disk image. Those lines have CR,LF converted to CR,CR instead of only CR.
I have never noticed this happening before, and can't see what might have triggered it.
The Windows file has 2480 lines and 72089 bytes in it, but only the last 229 lines are affected.
The command line doing the copy:
os9 copy -l -r KRNBOOT\dskboot.asm NOS9DEV.DSK,KRNBOOT/dskboot.asm
I am using ToolShed v2.2 on a Windows 7 system.
Has anyone else seen this behaviour? Any ideas as to what might be causing it?
Dave W
Anonymous
I have committed a simple fix for this. As posted in the discussion the issue can be reproduced and the fix verified with this:
A remaining corner case issue can be reproduced by changing -b11 to -b5 above.
I have added a proper unit test for this - a lot more work than above command lines :) - that also should help if we work more on this. The better fix is to determine the EOL encoding for the file once for all - hopefully the first chunk should be enough to determine it - and then stay with the same encoding for all remaining chunks.