[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.67 and 1.68

version 1.67, 2023/11/28 20:54:38 version 1.68, 2024/01/25 16:40:51
Line 23 
Line 23 
 THIS SOFTWARE.  THIS SOFTWARE.
 ****************************************************************/  ****************************************************************/
   
 const char      *version = "version 20231127";  const char      *version = "version 20240122";
   
 #define DEBUG  #define DEBUG
 #include <stdio.h>  #include <stdio.h>
Line 180 
Line 180 
                 }                  }
                 if (strcmp(argv[1], "--csv") == 0) {    /* turn on csv input processing */                  if (strcmp(argv[1], "--csv") == 0) {    /* turn on csv input processing */
                         CSV = true;                          CSV = true;
                         if (fs)  
                                 WARNING("danger: don't set FS when --csv is in effect");  
                         argc--;                          argc--;
                         argv++;                          argv++;
                         continue;                          continue;
Line 203 
Line 201 
                         break;                          break;
                 case 'F':       /* set field separator */                  case 'F':       /* set field separator */
                         fs = setfs(getarg(&argc, &argv, "no field separator"));                          fs = setfs(getarg(&argc, &argv, "no field separator"));
                         if (CSV)  
                                 WARNING("danger: don't set FS when --csv is in effect");  
                         break;                          break;
                 case 'v':       /* -v a=1 to be done NOW.  one -v for each */                  case 'v':       /* -v a=1 to be done NOW.  one -v for each */
                         vn = getarg(&argc, &argv, "no variable name");                          vn = getarg(&argc, &argv, "no variable name");
Line 237 
Line 233 
                         exit(1);                          exit(1);
                 }                  }
         }          }
   
           if (CSV && (fs != NULL || lookup("FS", symtab) != NULL))
                   WARNING("danger: don't set FS when --csv is in effect");
   
         /* argv[1] is now the first argument */          /* argv[1] is now the first argument */
         if (npfile == 0) {      /* no -f; first argument is program */          if (npfile == 0) {      /* no -f; first argument is program */

Legend:
Removed from v.1.67  
changed lines
  Added in v.1.68