]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_getstr.c
ncurses 5.6 - patch 20080712
[ncurses.git] / ncurses / base / lib_getstr.c
index 274e878873715ab4c483255a9a530b1633179cfd..8ce18b34f1faef3a0f57458751b1f48f9123c4c5 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2002,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -41,7 +41,7 @@
 #include <curses.priv.h>
 #include <term.h>
 
-MODULE_ID("$Id: lib_getstr.c,v 1.25 2006/01/12 00:33:52 tom Exp $")
+MODULE_ID("$Id: lib_getstr.c,v 1.26 2008/05/31 22:05:15 tom Exp $")
 
 /*
  * This wipes out the last character, no matter whether it was a tab, control
@@ -75,6 +75,7 @@ wgetnstr_events(WINDOW *win,
                int maxlen,
                EVENTLIST_1st(_nc_eventlist * evl))
 {
+    SCREEN *sp = _nc_screen_of(win);
     TTY buf;
     bool oldnl, oldecho, oldraw, oldcbreak;
     char erasec;
@@ -90,10 +91,10 @@ wgetnstr_events(WINDOW *win,
 
     _nc_get_tty_mode(&buf);
 
-    oldnl = SP->_nl;
-    oldecho = SP->_echo;
-    oldraw = SP->_raw;
-    oldcbreak = SP->_cbreak;
+    oldnl = sp->_nl;
+    oldecho = sp->_echo;
+    oldraw = sp->_raw;
+    oldcbreak = sp->_cbreak;
     nl();
     noecho();
     noraw();
@@ -187,10 +188,10 @@ wgetnstr_events(WINDOW *win,
     /* Restore with a single I/O call, to fix minor asymmetry between
      * raw/noraw, etc.
      */
-    SP->_nl = oldnl;
-    SP->_echo = oldecho;
-    SP->_raw = oldraw;
-    SP->_cbreak = oldcbreak;
+    sp->_nl = oldnl;
+    sp->_echo = oldecho;
+    sp->_raw = oldraw;
+    sp->_cbreak = oldcbreak;
 
     _nc_set_tty_mode(&buf);