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

Diff for /src/usr.bin/awk/main.c between version 1.58 and 1.59

version 1.58, 2023/09/10 14:59:00 version 1.59, 2023/09/17 14:49:44
Line 23 
Line 23 
 THIS SOFTWARE.  THIS SOFTWARE.
 ****************************************************************/  ****************************************************************/
   
 const char      *version = "version 20230909";  const char      *version = "version 20230913";
   
 #define DEBUG  #define DEBUG
 #include <stdio.h>  #include <stdio.h>
Line 52 
Line 52 
 static size_t   npfile;         /* number of filenames */  static size_t   npfile;         /* number of filenames */
 static size_t   curpfile;       /* current filename */  static size_t   curpfile;       /* current filename */
   
   bool    CSV = false;            /* true for csv input */
 bool    safe = false;           /* true => "safe" mode */  bool    safe = false;           /* true => "safe" mode */
 bool    do_posix = false;       /* true => POSIX mode */  bool    do_posix = false;       /* true => POSIX mode */
   
Line 170 
Line 171 
                         argv++;                          argv++;
                         break;                          break;
                 }                  }
                   if (strcmp(argv[1], "--csv") == 0) {    /* turn on csv input processing */
                           CSV = true;
                           argc--;
                           argv++;
                           continue;
                   }
                 switch (argv[1][1]) {                  switch (argv[1][1]) {
                 case 's':                  case 's':
                         if (strcmp(argv[1], "-safe") == 0)                          if (strcmp(argv[1], "-safe") == 0)
Line 179 
Line 186 
                         fn = getarg(&argc, &argv, "no program filename");                          fn = getarg(&argc, &argv, "no program filename");
                         if (npfile >= maxpfile) {                          if (npfile >= maxpfile) {
                                 maxpfile += 20;                                  maxpfile += 20;
                                 pfile = (char **) realloc(pfile, maxpfile * sizeof(*pfile));                                  pfile = (char **) reallocarray(pfile, maxpfile, sizeof(*pfile));
                                 if (pfile == NULL)                                  if (pfile == NULL)
                                         FATAL("error allocating space for -f options");                                          FATAL("error allocating space for -f options");
                         }                          }

Legend:
Removed from v.1.58  
changed lines
  Added in v.1.59