]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_newterm.c
ncurses 5.9 - patch 20130713
[ncurses.git] / ncurses / base / lib_newterm.c
index c276a0fccc1a4e0d08648c0a928a8da733c04147..a235dbdbe9c01b029c6ca9c422aa37f22922be2c 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2011,2012 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            *
 
 #include <curses.priv.h>
 
-#if SVR4_TERMIO && !defined(_POSIX_SOURCE)
-#define _POSIX_SOURCE
-#endif
-
 #ifndef CUR
 #define CUR SP_TERMTYPE
 #endif
 
 #include <tic.h>
 
-MODULE_ID("$Id: lib_newterm.c,v 1.84 2009/11/28 22:43:51 tom Exp $")
+MODULE_ID("$Id: lib_newterm.c,v 1.88 2012/01/21 19:21:29 KO.Myung-Hun Exp $")
 
 #ifdef USE_TERM_DRIVER
 #define NumLabels      InfoOf(SP_PARM).numlabels
@@ -85,9 +81,9 @@ _nc_initscr(NCURSES_SP_DCL0)
 
        buf = term->Nttyb;
 #ifdef TERMIOS
-       buf.c_lflag &= ~(ECHO | ECHONL);
-       buf.c_iflag &= ~(ICRNL | INLCR | IGNCR);
-       buf.c_oflag &= ~(ONLCR);
+       buf.c_lflag &= (unsigned) ~(ECHO | ECHONL);
+       buf.c_iflag &= (unsigned) ~(ICRNL | INLCR | IGNCR);
+       buf.c_oflag &= (unsigned) ~(ONLCR);
 #elif HAVE_SGTTY_H
        buf.sg_flags &= ~(ECHO | CRMOD);
 #else
@@ -242,7 +238,7 @@ NCURSES_SP_NAME(newterm) (NCURSES_SP_DCLx
 #ifdef USE_TERM_DRIVER
            TERMINAL_CONTROL_BLOCK *TCB;
 #elif !NCURSES_SP_FUNCS
-           SP_PARM = CURRENT_SCREEN;
+           _nc_set_screen(CURRENT_SCREEN);
 #endif
            assert(SP_PARM != 0);
            cols = *(ptrCols(SP_PARM));
@@ -283,7 +279,8 @@ NCURSES_SP_NAME(newterm) (NCURSES_SP_DCLx
            NCURSES_SP_NAME(typeahead) (NCURSES_SP_ARGx fileno(_ifp));
 #ifdef TERMIOS
            SP_PARM->_use_meta = ((new_term->Ottyb.c_cflag & CSIZE) == CS8 &&
-                                 !(new_term->Ottyb.c_iflag & ISTRIP));
+                                 !(new_term->Ottyb.c_iflag & ISTRIP)) ||
+               USE_KLIBC_KBD;
 #else
            SP_PARM->_use_meta = FALSE;
 #endif