Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!decvax!wivax!cadmus!harvard!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.unix-wizards Subject: Re: 4.2bsd eof flag in stdio Message-ID: <5901@brl-tgr.ARPA> Date: Mon, 19-Nov-84 11:54:19 EST Article-I.D.: brl-tgr.5901 Posted: Mon Nov 19 11:54:19 1984 Date-Received: Wed, 21-Nov-84 05:31:17 EST References: <1697@ucf-cs.UUCP> <1796@sun.uucp> <5867@brl-tgr.ARPA> <1246@utah-gr.UUCP> Organization: Ballistic Research Lab Lines: 20 > The problem is if you type 'foo^D' with no newline. You would expect > that this would terminate input reading, but it does not -- you must > type another ^D to finish it off. This is just what I expect. Why should the first ^D terminate input reading, since the read will return 3 characters at that point? > This is, of course, a matter of opinion, but all the documentation > states that ^D is the *end-of-file* character. Perhaps the > documentation (unchanged since my memory) is "buggy"? Yup. Kernighan & Pike got it right in their book. > This bug is in ALL versions of fread (and getchar, and ...) *except* > 4.2. The UNIX System V Release 2.0 fread() acts as I originally described, which is what I would expect. In any case, judging from the number of times people have had problems caused by this change, it was not a wise move.