commit 456b5de51b825a18cdbb752f066f27821c19f88a
parent afd962b9c06108ff0643e98593c5605314d76917
Author: Rich Lane <rlane@club.cc.cmu.edu>
Date: Fri, 1 Jan 2010 13:10:47 -0800
check NCURSES_OPAQUE to see if we can dereference a WINDOW pointer
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ncurses_wrap.c b/ncurses_wrap.c
@@ -819,7 +819,7 @@ static int rbncurshelper_nonblocking_wgetch(WINDOW *c_win) {
int halfdelay = NUM2INT(rb_iv_get(mNcurses, "@halfdelay"));
int infd = NUM2INT(rb_iv_get(mNcurses, "@infd"));
double screen_delay = halfdelay * 0.1;
-#ifdef NCURSES_VERSION
+#if defined(NCURSES_VERSION) && defined(NCURSES_OPAQUE) && !NCURSES_OPAQUE
int windelay = c_win->_delay;
#else
int windelay = 0;
@@ -843,7 +843,7 @@ static int rbncurshelper_nonblocking_wgetch(WINDOW *c_win) {
starttime = tv.tv_sec + tv.tv_usec * 1e-6;
#endif
finishtime = starttime + delay;
-#ifdef NCURSES_VERSION
+#if defined(NCURSES_VERSION) && defined(NCURSES_OPAQUE) && !NCURSES_OPAQUE
c_win->_delay = 0;
#endif
while (doupdate() /* detects resize */, (result = wgetch(c_win)) == ERR) {
@@ -898,7 +898,7 @@ static int rbncurshelper_nonblocking_wgetch(WINDOW *c_win) {
#endif
#endif
}
-#ifdef NCURSES_VERSION
+#if defined(NCURSES_VERSION) && defined(NCURSES_OPAQUE) && !NCURSES_OPAQUE
c_win->_delay = windelay;
#endif
return result;