MSVCRT: In unbuffered text mode reading \r\n with fgetc fails

Uwe Bonnes bon at hertz.ikp.physik.tu-darmstadt.de
Sun Jan 10 08:08:51 CST 2010


Add a test case that shows that in unbufferes text mode fgetc() fails when
reading \r\n
---
 dlls/msvcrt/tests/file.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/dlls/msvcrt/tests/file.c b/dlls/msvcrt/tests/file.c
index dd1baaa..a4ba47c 100644
--- a/dlls/msvcrt/tests/file.c
+++ b/dlls/msvcrt/tests/file.c
@@ -466,6 +466,14 @@ static void test_fgetc( void )
   ret = fgetc(tempfh);
   ok(ich == ret, "Second fgetc expected %x got %x\n", ich, ret);
   fclose(tempfh);
+  tempfh = fopen(tempf,"wt");
+  fputc('\n', tempfh);
+  fclose(tempfh);
+  tempfh = fopen(tempf,"wt");
+  setbuf(tempfh, NULL);
+  ret = fgetc(tempfh);
+  ok(ret == -1, "Unbuffered fgetc in text mode must failed on \\r\\n\n");
+  fclose(tempfh);
   unlink(tempf);
   free(tempf);
 }
-- 
1.6.4.2




More information about the wine-patches mailing list