aboutsummaryrefslogtreecommitdiff
path: root/ncurses/tinfo/lib_raw.c
diff options
context:
space:
mode:
Diffstat (limited to 'ncurses/tinfo/lib_raw.c')
-rw-r--r--ncurses/tinfo/lib_raw.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/ncurses/tinfo/lib_raw.c b/ncurses/tinfo/lib_raw.c
index 928692b0cb27..173b3a36551a 100644
--- a/ncurses/tinfo/lib_raw.c
+++ b/ncurses/tinfo/lib_raw.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2016,2017 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 *
@@ -49,7 +49,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_raw.c,v 1.21 2012/01/21 19:21:29 KO.Myung-Hun Exp $")
+MODULE_ID("$Id: lib_raw.c,v 1.23 2017/04/15 22:24:45 tom Exp $")
#if HAVE_SYS_TERMIO_H
#include <sys/termio.h> /* needed for ISC */
@@ -112,8 +112,10 @@ NCURSES_SP_NAME(raw) (NCURSES_SP_DCL0)
kbdinfo.fsMask |= KEYBOARD_BINARY_MODE;
KbdSetStatus(&kbdinfo, 0);
#endif
- SP_PARM->_raw = TRUE;
- SP_PARM->_cbreak = 1;
+ if (SP_PARM) {
+ SP_PARM->_raw = TRUE;
+ SP_PARM->_cbreak = 1;
+ }
termp->Nttyb = buf;
}
AFTER("raw");
@@ -154,7 +156,9 @@ NCURSES_SP_NAME(cbreak) (NCURSES_SP_DCL0)
#endif
result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
if (result == OK) {
- SP_PARM->_cbreak = 1;
+ if (SP_PARM) {
+ SP_PARM->_cbreak = 1;
+ }
termp->Nttyb = buf;
}
AFTER("cbreak");
@@ -177,12 +181,12 @@ cbreak(void)
NCURSES_EXPORT(void)
NCURSES_SP_NAME(qiflush) (NCURSES_SP_DCL0)
{
- int result = ERR;
TERMINAL *termp;
T((T_CALLED("qiflush(%p)"), (void *) SP_PARM));
if ((termp = TerminalOf(SP_PARM)) != 0) {
TTY buf;
+ int result;
BEFORE("qiflush");
buf = termp->Nttyb;
@@ -190,6 +194,7 @@ NCURSES_SP_NAME(qiflush) (NCURSES_SP_DCL0)
buf.c_lflag &= (unsigned) ~(NOFLSH);
result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
#else
+ result = ERR;
/* FIXME */
#endif
if (result == OK)
@@ -241,8 +246,10 @@ NCURSES_SP_NAME(noraw) (NCURSES_SP_DCL0)
kbdinfo.fsMask |= KEYBOARD_ASCII_MODE;
KbdSetStatus(&kbdinfo, 0);
#endif
- SP_PARM->_raw = FALSE;
- SP_PARM->_cbreak = 0;
+ if (SP_PARM) {
+ SP_PARM->_raw = FALSE;
+ SP_PARM->_cbreak = 0;
+ }
termp->Nttyb = buf;
}
AFTER("noraw");
@@ -280,7 +287,9 @@ NCURSES_SP_NAME(nocbreak) (NCURSES_SP_DCL0)
#endif
result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
if (result == OK) {
- SP_PARM->_cbreak = 0;
+ if (SP_PARM) {
+ SP_PARM->_cbreak = 0;
+ }
termp->Nttyb = buf;
}
AFTER("nocbreak");
@@ -299,12 +308,12 @@ nocbreak(void)
NCURSES_EXPORT(void)
NCURSES_SP_NAME(noqiflush) (NCURSES_SP_DCL0)
{
- int result = ERR;
TERMINAL *termp;
T((T_CALLED("noqiflush(%p)"), (void *) SP_PARM));
if ((termp = TerminalOf(SP_PARM)) != 0) {
TTY buf;
+ int result;
BEFORE("noqiflush");
buf = termp->Nttyb;
@@ -313,6 +322,7 @@ NCURSES_SP_NAME(noqiflush) (NCURSES_SP_DCL0)
result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
#else
/* FIXME */
+ result = ERR;
#endif
if (result == OK)
termp->Nttyb = buf;