Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ncr-sd.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!ittatc!dcdwest!sdcsvax!ncr-sd!laman From: laman@ncr-sd.UUCP (Mike Laman) Newsgroups: net.unix-wizards Subject: Re: Problem with curses ``getstr()''. Message-ID: <311@ncr-sd.UUCP> Date: Tue, 22-Oct-85 20:49:10 EDT Article-I.D.: ncr-sd.311 Posted: Tue Oct 22 20:49:10 1985 Date-Received: Fri, 25-Oct-85 01:45:21 EDT References: <137@oberon.UUCP> Reply-To: laman@ncr-sd.UUCP (Mike Laman) Distribution: net Organization: NCR Corporation, Torrey Pines Lines: 39 In article <137@oberon.UUCP> mcooper@oberon.UUCP (Michael Cooper) writes: >Ahh, yes. Another curses problem. Or at least it is a problem >that curses is having with me! I am trying to get a string from a window >with wgetstr(win, buf). Now I checked both in the documentation and >getstr.c and both say that getstr reads up to a newline ('\n') or EOF. >When I put this into practice, though, it just plain doesn't work. It >keeps reading everything in. This includes newlines, SIGINTR, SIGKILL, >SIGSUSP. The only way to get out of it is to use another terminal and kill >the program's process. > >Would somebody care to point out something that I missed? Or is it >just another bug from the braindamaged Berzerkeley? If so, anybody want to >volunteer a fix? > Sure, I'll volunteer a fix. This is an amazingly simple one. Don't ask me how it got through, but one would suspect the wgetstr (or getstr) aren't used much :-). In wgetstr() you will see the loop: Opps | | V while ((*str = wgetch(win)) != ERR && *str != '\n'); str++; if (*str == ERR) { : : Yep. Remove the semicolon and have fun. Maybe I should post my list of bug fixes for the 4.2 BSD curses library again (to net.bugs.4bsd)? If anyone thinks so, then let me know by mail. If I get a few requests, I'll post my file of bug fixes again. It has been a while. Mike Laman, NCR @ Rancho Bernardo UUCP: {ucbvax,philabs,sdcsla}!sdcsvax!ncr-sd!laman