getchar() question in 4.2

tony at asgb.UUCP tony at asgb.UUCP
Wed May 2 01:05:00 AEST 1984


The stdio library was modified in 4.2 so that an EOF condition is not cleared
as it used to be on subsequent reads from a tty. That breaks a lot of things
that used to act intelligently on EOF (learn, for example).

The easiest fix is to call "clrerr(stdin)" when an EOF is detected to reset
the condition. Further reads should then work.

I don't know what the rationale for this change was, but it's probably safer
to fix the things it affects than to revert to the old behavior of stdio.

Tony Andrews
Burroughs Corp.
ihnp4!sdcrdcf!bmcg!asgb!tony



More information about the Comp.unix.wizards mailing list