[BACK]Return to process.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sed

Diff for /src/usr.bin/sed/process.c between version 1.22 and 1.23

version 1.22, 2015/04/13 05:11:23 version 1.23, 2015/04/18 18:28:37
Line 457 
Line 457 
         static int termwidth = -1;          static int termwidth = -1;
   
         if (termwidth == -1) {          if (termwidth == -1) {
                   termwidth = 0;
                 if ((p = getenv("COLUMNS")))                  if ((p = getenv("COLUMNS")))
                         termwidth = atoi(p);                          termwidth = strtonum(p, 0, INT_MAX, NULL);
                 else if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 &&                  if (termwidth == 0 &&
                       ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 &&
                     win.ws_col > 0)                      win.ws_col > 0)
                         termwidth = win.ws_col;                          termwidth = win.ws_col;
                 else                  if (termwidth == 0)
                         termwidth = 60;                          termwidth = 60;
         }          }
   

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23