http://bugs.winehq.org/show_bug.cgi?id=16970
Summary: read exactly on newline boundary returns the \r (crlf not being performed) Product: Wine Version: unspecified Platform: All OS/Version: All Status: UNCONFIRMED Severity: major Priority: P2 Component: msvcrt AssignedTo: wine-bugs@winehq.org ReportedBy: lkcl@lkcl.net
this test demonstrates that msvcrt read, on a newline boundary, fails to have the crlf converted to lf.
expected results (as confirmed from using msvcrt.dll "native"): f.readline(5) should equal "hell\n" and instead it is returning "hell\r".
this simple boundary-case is responsible for virtually every single one of the remaining python/wine regression test failures!
this should be very easy to replicate in c-code.
lkcl@gonzalez:~/src/python2.5-2.5.2$ ./python.exe Python 2.5.2 (r252:60911, Jan 16 2009, 22:06:34) [gcc-mingw32] on win32 Type "help", "copyright", "credits" or "license" for more information.
f = open("tst", "w") f.write("hell\n") f.write("back\n") f.close()
lkcl@gonzalez:~/src/python2.5-2.5.2$ more tst <-- faked up to show ^Ms hell^M back^M lkcl@gonzalez:~/src/python2.5-2.5.2$ % ./python.exe f = open("tst", "r")
x = f.readline(5) x
'hell\r' <------- wrongggggg
f.seek(0) f.readline()
'hell\n' <-------- ah _ha_. if you don't specify the length to be read....
f.seek(0) f.readline(4)
'hell'
f.readline()
'\n'
http://bugs.winehq.org/show_bug.cgi?id=16970
Jeff Zaroyko jeffz@jeffz.name changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|major |normal
--- Comment #1 from Jeff Zaroyko jeffz@jeffz.name 2009-01-17 05:22:50 --- which version of Wine are you testing with?
http://bugs.winehq.org/show_bug.cgi?id=16970
Luke Kenneth Casson Leighton lkcl@lkcl.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major
--- Comment #2 from Luke Kenneth Casson Leighton lkcl@lkcl.net 2009-01-17 10:41:23 --- ok - tracked this down to _MT _not_ being defined such that MSVCRT__filbuf is being _directly_ called (see stdio.h)
and in dlls/msvcrt/file.c MSVCRT__filbuf is _not_ performing CRLF skipping.
so, anyway - good luck with that, because i notice that MSVCRT__filbuf is used by MSVCRT_fgetwc which is probably either a _really_ bad idea or a very smart one (i.e. it would actually work) ... but, i notice there's a "FIXME" on fgetwc() anyway... so who caaaares!!
http://bugs.winehq.org/show_bug.cgi?id=16970
--- Comment #3 from Luke Kenneth Casson Leighton lkcl@lkcl.net 2009-01-17 10:41:57 ---
which version of Wine are you testing with?
1.0.1, jeff.
http://bugs.winehq.org/show_bug.cgi?id=16970
--- Comment #4 from Luke Kenneth Casson Leighton lkcl@lkcl.net 2009-01-17 13:51:26 --- lkcl@gonzalez:~/src/winebug-16970$ !./ ./a.exe char: 0 char: 49 1 char: 43 + char: 49 1 char: 13 char: 10
http://bugs.winehq.org/show_bug.cgi?id=16970
--- Comment #5 from Luke Kenneth Casson Leighton lkcl@lkcl.net 2009-01-17 13:53:42 --- Created an attachment (id=18767) --> (http://bugs.winehq.org/attachment.cgi?id=18767) test
http://bugs.winehq.org/show_bug.cgi?id=16970
--- Comment #6 from Luke Kenneth Casson Leighton lkcl@lkcl.net 2009-01-17 13:53:56 --- Created an attachment (id=18768) --> (http://bugs.winehq.org/attachment.cgi?id=18768) prebuilt test
http://bugs.winehq.org/show_bug.cgi?id=16970
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dank@kegel.com Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #7 from Dan Kegel dank@kegel.com 2009-01-17 16:01:43 --- fix coming, see http://www.winehq.org/pipermail/wine-devel/2009-January/072191.html
http://bugs.winehq.org/show_bug.cgi?id=16970
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED
--- Comment #8 from Dan Kegel dank@kegel.com 2009-01-17 16:03:09 --- may as well assign it to me.
http://bugs.winehq.org/show_bug.cgi?id=16970
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase
http://bugs.winehq.org/show_bug.cgi?id=16970
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |1.0.1
--- Comment #9 from Austin English austinenglish@gmail.com 2009-01-17 23:27:02 --- (In reply to comment #3)
which version of Wine are you testing with?
1.0.1, jeff.
You should be testing in 1.1.13 (latest development release).
http://bugs.winehq.org/show_bug.cgi?id=16970
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- OS/Version|All |other Platform|All |Other
http://bugs.winehq.org/show_bug.cgi?id=16970
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED
--- Comment #10 from Dan Kegel dank@kegel.com 2009-01-19 10:38:57 --- patch committed, http://www.winehq.org/pipermail/wine-cvs/2009-January/051987.html Please verify that wine from git works for you, if not, please reopen.
http://bugs.winehq.org/show_bug.cgi?id=16970
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #11 from Alexandre Julliard julliard@winehq.org 2009-01-30 11:05:01 --- Closing bugs fixed in 1.1.14.