/[man-db]/man-db/src/man.c
ViewVC logotype

Diff of /man-db/src/man.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.94 by cjwatson, Thu May 1 18:14:11 2003 UTC revision 1.95 by cjwatson, Mon May 5 18:48:29 2003 UTC
# Line 490  static int tms_set = 0; Line 490  static int tms_set = 0;
490  static void set_term (void)  static void set_term (void)
491  {  {
492          if (tms_set)          if (tms_set)
493                  tcsetattr (0, TCSANOW, &tms);                  tcsetattr (fileno (stdin), TCSANOW, &tms);
494  }  }
495    
496  static void get_term (void)  static void get_term (void)
497  {  {
498          if (isatty (1)) {          if (isatty (fileno (stdout))) {
499                  if (debug)                  if (debug)
500                          fprintf(stderr, "is a tty\n");                          fprintf(stderr, "is a tty\n");
501                  tcgetattr (0, &tms);                  tcgetattr (fileno (stdin), &tms);
502                  if (!tms_set++)                  if (!tms_set++)
503                          atexit (set_term);                          atexit (set_term);
504          }          }
# Line 533  static void store_line_length (void) Line 533  static void store_line_length (void)
533          }          }
534    
535  #ifdef TIOCGWINSZ  #ifdef TIOCGWINSZ
536          if (isatty(0) && isatty(1)) { /* Jon Tombs */          /* Jon Tombs */
537            if (isatty (fileno (stdin)) && isatty (fileno (stdout))) {
538                  struct winsize wsz;                  struct winsize wsz;
539    
540                  if (ioctl (0, TIOCGWINSZ, &wsz))                  if (ioctl (fileno (stdin), TIOCGWINSZ, &wsz))
541                          perror ("TIOCGWINSZ failed\n");                          perror ("TIOCGWINSZ failed\n");
542                  else if (wsz.ws_col) {                  else if (wsz.ws_col) {
543                          line_length = wsz.ws_col;                          line_length = wsz.ws_col;

Legend:
Removed from v.1.94  
changed lines
  Added in v.1.95

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26