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

Diff for /src/usr.bin/uniq/uniq.c between version 1.31 and 1.32

version 1.31, 2022/01/01 02:20:38 version 1.32, 2022/01/01 17:44:18
Line 45 
Line 45 
 #include <wchar.h>  #include <wchar.h>
 #include <wctype.h>  #include <wctype.h>
   
   long long numchars, numfields;
   unsigned long long repeats;
 int cflag, dflag, iflag, uflag;  int cflag, dflag, iflag, uflag;
 int numchars, numfields, repeats;  
   
 void     show(const char *);  void     show(const char *);
 char    *skip(char *);  char    *skip(char *);
Line 78 
Line 79 
                         dflag = 1;                          dflag = 1;
                         break;                          break;
                 case 'f':                  case 'f':
                         numfields = (int)strtonum(optarg, 0, INT_MAX,                          numfields = strtonum(optarg, 0, LLONG_MAX, &errstr);
                             &errstr);  
                         if (errstr)                          if (errstr)
                                 errx(1, "field skip value is %s: %s",                                  errx(1, "field skip value is %s: %s",
                                     errstr, optarg);                                      errstr, optarg);
Line 88 
Line 88 
                         iflag = 1;                          iflag = 1;
                         break;                          break;
                 case 's':                  case 's':
                         numchars = (int)strtonum(optarg, 0, INT_MAX,                          numchars = strtonum(optarg, 0, LLONG_MAX, &errstr);
                             &errstr);  
                         if (errstr)                          if (errstr)
                                 errx(1,                                  errx(1,
                                     "character skip value is %s: %s",                                      "character skip value is %s: %s",
Line 187 
Line 186 
 {  {
         if ((dflag && repeats) || (uflag && !repeats)) {          if ((dflag && repeats) || (uflag && !repeats)) {
                 if (cflag)                  if (cflag)
                         printf("%4d %s\n", repeats + 1, str);                          printf("%4llu %s\n", repeats + 1, str);
                 else                  else
                         printf("%s\n", str);                          printf("%s\n", str);
         }          }
Line 196 
Line 195 
 char *  char *
 skip(char *str)  skip(char *str)
 {  {
           long long nchars, nfields;
         wchar_t wc;          wchar_t wc;
         int nchars, nfields;  
         int len;          int len;
         int field_started;          int field_started;
   

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32