bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Minor bugs


From: Philippe Blain
Subject: Minor bugs
Date: Fri, 19 Jul 2002 05:44:50 +0200

>From Philippe Blain, Bordeaux, FRANCE - pblain @ free.fr
My old computer:P133 - 8, 4 Go - 32 Mo Red Hat Linux 7.0

To maintainers of 'ncurses'.(and to Mr Dickey)
Subject: Minor corrections for ncurses-5.2-20020713+

Here are some problems I found:

----------------------------------------------------------------------------
----
File:ncurses/base/lib_newterm.c

Function _nc_initscr ()

Same thing as in lib_raw.c
Use of a buffer to prevent updating if function fails :

static inline int _nc_initscr (void)
{
 int result = ERR;

 if (cur_term != 0) {
  /* For extended XPG4 conformance requires cbreak() at this point.
     (SVr4 curses does this anyway) */
  if (cbreak () == OK) {
   TTY buf;

   buf = cur_term->Nttyb;
#ifdef TERMIOS
   buf.c_lflag &= ~(ECHO | ECHONL);
   buf.c_iflag &= ~(ICRNL | INLCR | IGNCR);
   buf.c_oflag &= ~(ONLCR);
#else
   buf.sg_flags &= ~(ECHO | CRMOD);
#endif
   if ((result = _nc_set_tty_mode (&buf)) == OK) {
    cur_term->Nttyb = buf;
   }
  }
 }
 return (result);
}
----------------------------------------------------------------------------
----
File:ncurses/base/lib_screen.c

Function scr_init ()

If you remove the test on dumptime, you can remove fstat and stb also.

Before 20020713 :
-    else if (fstat(STDOUT_FILENO, &stb) || stb.st_mtime > dumptime)
After 20020713 :
+    } else if (fstat(STDOUT_FILENO, &stb)) {
  returnCode(ERR);

----------------------------------------------------------------------------
----
File:ncurses/base/lib_ttyflags.c

Function reset_prog_mode ()

Need to test the return value of '_nc_set_tty_mode' before returning an
appropriate error code for the function.
Something like that :

NCURSES_EXPORT (int) reset_prog_mode (void)
{
 T ((T_CALLED ("reset_prog_mode()")));

 if (_nc_set_tty_mode (&cur_term->Nttyb) != OK)
  returnCode (ERR);
 if (SP) {
  if (SP->_keypad_on)
   _nc_keypad (TRUE);
  NC_BUFFERED (TRUE);
 }
 returnCode (OK);
}

----------------------------------------------------------------------------
----
- Philippe





reply via email to

[Prev in Thread] Current Thread [Next in Thread]