X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=ncurses%2Fbase%2Flib_getch.c;h=6f4f3c54e5b8e8b254eb435e987752ea7543a771;hb=92e187a3459ab7ce1613a3684ca6642447c73620;hp=09d4ea1c0f6a6a1b404d5c8187f8cd6c9de85d9d;hpb=11dead39816318fe9601e27756b9497caf7ff490;p=ncurses.git diff --git a/ncurses/base/lib_getch.c b/ncurses/base/lib_getch.c index 09d4ea1c..6f4f3c54 100644 --- a/ncurses/base/lib_getch.c +++ b/ncurses/base/lib_getch.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_getch.c,v 1.111 2010/04/10 19:08:59 tom Exp $") +MODULE_ID("$Id: lib_getch.c,v 1.116 2010/05/01 22:40:47 tom Exp $") #include @@ -376,6 +376,7 @@ _nc_wgetch(WINDOW *win, { SCREEN *sp; int ch; + int rc = 0; #ifdef NCURSES_WGETCH_EVENTS long event_delay = -1; #endif @@ -411,17 +412,18 @@ _nc_wgetch(WINDOW *win, !sp->_cbreak && !sp->_called_wgetch) { char buf[MAXCOLUMNS], *bufp; - int rc; TR(TRACE_IEVENT, ("filling queue in cooked mode")); - rc = recur_wgetnstr(win, buf); - /* ungetch in reverse order */ #ifdef NCURSES_WGETCH_EVENTS + rc = recur_wgetnstr(win, buf); if (rc != KEY_EVENT) -#endif safe_ungetch(sp, '\n'); +#else + (void) recur_wgetnstr(win, buf); + safe_ungetch(sp, '\n'); +#endif for (bufp = buf + strlen(buf); bufp > buf; bufp--) safe_ungetch(sp, bufp[-1]); @@ -443,7 +445,6 @@ _nc_wgetch(WINDOW *win, if (win->_notimeout || (win->_delay >= 0) || (sp->_cbreak > 1)) { if (head == -1) { /* fifo is empty */ int delay; - int rc; TR(TRACE_IEVENT, ("timed delay in wgetch()")); if (sp->_cbreak > 1) @@ -486,7 +487,6 @@ _nc_wgetch(WINDOW *win, * increase the wait with mouseinterval(). */ int runcount = 0; - int rc = 0; do { ch = kgetch(sp EVENTLIST_2nd(evl));