From 4d3952f3dc2b54a256726d5693adabcbefcc34d9 Mon Sep 17 00:00:00 2001 From: Duane Clark Date: Tue, 8 Aug 2006 16:08:05 -0700 Subject: [PATCH] msvcrt: In text mode a ctrl-z signals EOF. Spotted by David Hagood with test suggested by Dan Kegel. --- dlls/msvcrt/file.c | 13 +++++++++++ dlls/msvcrt/tests/file.c | 48 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 9fe09ddd000..ba5b445ce49 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -1634,6 +1634,19 @@ static int read_i(int fd, void *buf, unsigned int count) */ if (ReadFile(hand, bufstart, count, &num_read, NULL)) { + if (MSVCRT_fdesc[fd].wxflag & WX_TEXT) + { + int i; + /* in text mode, a ctrl-z signals EOF */ + for (i=0; i