1.5.19-4: BUG: Using tellg() skips characters on files with DOS line endings

Yuriy Solodkyy solodon@mail.com
Mon Jun 12 01:42:00 GMT 2006


Hi,

I've got the following bug that only reproduces itself under Cygwin environment. Using basic_istream::tellg() on files with DOS line endings results in skipping characters from the input. Attached program tellg-bug.cpp tries to reproduce the behavior using a test file test.txt. Commenting out call to tellg() results in correct reading of characters while presence of call to tellg() results in skipping a number of characters that is equal to the number of lines (line endings) in the file. NOTE: File test.txt must have DOS line endings for the bug to be reproducible so please make sure these line endings were not changed while sent over the internet. Converting file to UNIX format with dos2unix utility effectively removes the bug.

I think this bug may be related to the following discussions on the Internet:

http://sourceforge.net/mailarchive/message.php?msg_id=6614018
http://www.cygwin.com/ml/cygwin/2001-03/msg00399.html

Kind regards,
Yuriy

-- 
___________________________________________________
Play 100s of games for FREE! http://games.mail.com/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tellg-bug.cpp
Type: application/octet-stream
Size: 604 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20060612/000adda5/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 21104 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20060612/000adda5/attachment-0001.obj>
-------------- next part --------------
<123>
The number of chars skipped
depends on the number of lines
in this file
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list