Q32801 CTRL+Z (^Z) Does Not Clear Reading from stdin
C Compiler
5.10   | 5.10
MS-DOS | OS/2

Summary:

The program below reads everything correctly the first time through
the loop; however, it fails on subsequent readings unless the file is
closed and reopened or freopen is called.

Microsoft has confirmed this to be a problem in Version 5.10 of the C
compiler. We are researching this problem and will post new
information as it becomes available.

More Information:

The following code demonstrates this problem:

#include <stdio.h>

main()
{
  char buffer[80];

  for (;;) {
     flushall();
     fflush(stdin);
     clearerr(stdin);
     fprintf(stdout,"Let's enter some text (^Z to stop, ^C to abort)\n");
     while (fgets(buffer,80,stdin) != NULL) {
             fputs(buffer,stdout);
          }
        }
}

Keywords:  buglist5.10
Updated  88/09/24 08:09
