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

Diff for /src/usr.bin/sed/main.c between version 1.23 and 1.24

version 1.23, 2015/07/19 06:14:23 version 1.24, 2015/07/19 17:21:21
Line 34 
Line 34 
  */   */
   
 #include <sys/types.h>  #include <sys/types.h>
   #include <sys/ioctl.h>
 #include <sys/stat.h>  #include <sys/stat.h>
   
 #include <ctype.h>  #include <ctype.h>
Line 102 
Line 103 
 static void add_file(char *);  static void add_file(char *);
 static int next_files_have_lines(void);  static int next_files_have_lines(void);
   
   int termwidth;
   
 int  int
 main(int argc, char *argv[])  main(int argc, char *argv[])
 {  {
           struct winsize win;
         int c, fflag;          int c, fflag;
           char *p;
   
         fflag = 0;          fflag = 0;
         inplace = NULL;          inplace = NULL;
Line 144 
Line 149 
                 }                  }
         argc -= optind;          argc -= optind;
         argv += optind;          argv += optind;
   
           if ((p = getenv("COLUMNS")))
                   termwidth = strtonum(p, 0, INT_MAX, NULL);
           if (termwidth == 0 &&
               ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 &&
               win.ws_col > 0)
                   termwidth = win.ws_col;
           if (termwidth == 0)
                   termwidth = 60;
   
         /* First usage case; script is the first arg */          /* First usage case; script is the first arg */
         if (!eflag && !fflag && *argv) {          if (!eflag && !fflag && *argv) {

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