I think I found a bug in the ASCII file transfer converter : It converts EOL in files by blocks (class FileBuffer)
when using SFTP protocol, my Winscp transfer 262148 bytes and convert them, then transfer 262148 bytes and convert them etc.
The problem I have is the following :
- I connect FROM a windows server (whose EOL is CR+LF)
- I connect TO a linux server (whos EOL is LF)
- I GET a file
- the file is a .txt who is using DOS EOL (CR+LF)
The FileBuffer::convert functions is smart enough to NOT add one more CR to the existing CR+LF
However, since it converts LF to CR+LF for a BLOCK at a time, I have a RARE CASE when the 262148 block ends by a CR :
the next block STARTS BY A LF !! So the "convert" functions adds a CR to it !
So in this very rare case, the ascii converter transform ONE CR+LF into CR+CR+LF !
and that happen one time in the middle of my file ! ...
the convert function should remember if the latest block ended by CR (or LF for MAC EOL convertion)
if you need more explanation or a test file, don't hesitate, I know how to reproduce it
(tested on version 4.3.2)