Path: utzoo!utgpu!water!watmath!clyde!att!alberta!ubc-cs!uw-beaver!cornell!mailrus!uflorida!novavax!proxftl!bill From: bill@proxftl.UUCP (T. William Wells) Newsgroups: comp.lang.c Subject: Re: Getchar w/wout echo Message-ID: <641@proxftl.UUCP> Date: 28 Aug 88 22:52:49 GMT References: <371@marob.MASA.COM> <65071@sun.uucp> <624@proxftl.UUCP> <8384@smoke.ARPA> Reply-To: bill@proxftl.UUCP (T. William Wells) Organization: Proximity Technology, Ft. Lauderdale Lines: 42 Summary: Expires: Sender: Followup-To: Distribution: Keywords: In article <8384@smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: : In article <624@proxftl.UUCP> bill@proxftl.UUCP (T. William Wells) writes: : >#define getchar() (putchar(getchar())) : : Ahem. Consider (in UNIX shell notation): : filter outfile : : There really is no way to do this right in the application code; : it has to be dealt with in the run-time environment. Please recall that he wanted a fix for his Macintosh, where there is no such thing as a command line, much less redirection. (Actually, I hear that there is a kludge in Lightspeed C that lets the user type in part of a command line at program start; but according to a guy who is working with that compiler, getchar() echoes when this kludge is used, so I suppose that the guy with the problem isn't using this kludge.) Of course, you really should have got me for this; I wrote: : #define getchar() (putchar(getchar())) And I should have written: : #define getchar() (putchar(getc(stdin))) I do agree that this would be a brain-damaged thing to do on almost any other system. And, I agree, the run-time environment should deal with this; that was the first thing I said in the message that you responded to: In article <624@proxftl.UUCP> I wrote: : In article <65071@sun.uucp> swilson@sun.UUCP (Scott Wilson) writes: : : Making a window look : : like a terminal is a function of the C libraries. : : Agreed. And your compiler is broken for not doing this : correctly. --- Bill novavax!proxftl!bill