Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site uthub.UUCP Path: utzoo!utcsrgv!utai!uthub!larry From: larry@uthub.UUCP (Larry Philps) Newsgroups: net.unix-wizards Subject: Re: getchar() question in 4.2 Message-ID: <148@uthub.UUCP> Date: Wed, 2-May-84 15:14:09 EDT Article-I.D.: uthub.148 Posted: Wed May 2 15:14:09 1984 Date-Received: Wed, 2-May-84 17:22:36 EDT References: <12654@sri-arpa.UUCP> <468@asgb.UUCP> Organization: CSRG, University of Toronto Lines: 26 [] I have also been bothered by the change in the stdio "get" interface. In particular the code that was changed is in filbuf.c where |_IOEOF was added to the if condition. if (iop->_flag&(_IOSTRG|_IOEOF)) return(EOF); This is a reasonable thing to do when reading from a real file, but when the reads are from a tty, it is quite possible to have multiple EOF's on the same stream (ex. learn, addbib, ...). Can anyone think of any problems that would result from changing the above to: if (iop->_flag&_IOSTRG) return(EOF); if ((iop->_flag&_IOEOF) && !isatty(fileno(iop))) return(EOF); This would force the 4.1BSD protocol when reading from tty's and the 4.2BSD protocol at all other times. I have not tried this myself, but think it should work without mucking up anything else. -- UUCP: { allegra cornell decvax decwrl floyd ihnp4 linus sask ubc-vision utzoo uw-beaver watmath } !utcsrgv!uthub!larry