BSD 4_1_snap release
[unix-history] / usr / src / lib / libcurses / getch.c
index 4ff7334..d6f22f5 100644 (file)
@@ -3,7 +3,7 @@
 /*
  *     This routine reads in a character from the window.
  *
 /*
  *     This routine reads in a character from the window.
  *
- * %G% (Berkeley) @(#)getch.c  1.2
+ * 7/8/81 (Berkeley) @(#)getch.c       1.2
  */
 wgetch(win)
 reg WINDOW     *win; {
  */
 wgetch(win)
 reg WINDOW     *win; {
@@ -12,7 +12,7 @@ reg WINDOW    *win; {
        reg char        inp;
 
        if (!win->_scroll && (win->_flags&_FULLWIN)
        reg char        inp;
 
        if (!win->_scroll && (win->_flags&_FULLWIN)
-           && win->_curx == win->_maxx - 1 && win->_cury == win->_maxy - 1)
+           && win->_curx == win->_maxx && win->_cury == win->_maxy)
                return ERR;
 # ifdef DEBUG
        fprintf(outf, "WGETCH: _echoit = %c, _rawmode = %c\n", _echoit ? 'T' : 'F', _rawmode ? 'T' : 'F');
                return ERR;
 # ifdef DEBUG
        fprintf(outf, "WGETCH: _echoit = %c, _rawmode = %c\n", _echoit ? 'T' : 'F', _rawmode ? 'T' : 'F');
@@ -26,7 +26,7 @@ reg WINDOW    *win; {
        fprintf(outf,"WGETCH got '%s'\n",unctrl(inp));
 # endif
        if (_echoit) {
        fprintf(outf,"WGETCH got '%s'\n",unctrl(inp));
 # endif
        if (_echoit) {
-               mvwaddch(curscr, win->_cury, win->_curx, inp);
+               mvwaddch(curscr, win->_begy+win->_cury, win->_begx+win->_curx, inp);
                waddch(win, inp);
        }
        if (weset)
                waddch(win, inp);
        }
        if (weset)