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

Diff for /src/usr.bin/last/last.c between version 1.30 and 1.31

version 1.30, 2004/01/08 13:36:52 version 1.31, 2004/06/16 22:30:08
Line 109 
Line 109 
 int  int
 main(int argc, char *argv[])  main(int argc, char *argv[])
 {  {
         extern int optind;          const char *errstr;
         extern char *optarg;  
         int ch;  
         char *p;          char *p;
           int ch;
   
         maxrec = -1;          maxrec = -1;
         snaptime = 0;          snaptime = 0;
         while ((ch = getopt(argc, argv, "0123456789cf:h:st:d:T")) != -1)          while ((ch = getopt(argc, argv, "0123456789cf:h:n:st:d:T")) != -1)
                 switch (ch) {                  switch (ch) {
                 case '0': case '1': case '2': case '3': case '4':                  case '0': case '1': case '2': case '3': case '4':
                 case '5': case '6': case '7': case '8': case '9':                  case '5': case '6': case '7': case '8': case '9':
Line 130 
Line 129 
                                         maxrec = atol(++p);                                          maxrec = atol(++p);
                                 else                                  else
                                         maxrec = atol(argv[optind] + 1);                                          maxrec = atol(argv[optind] + 1);
                                 if (!maxrec)                                  if (maxrec == 0)
                                         exit(0);                                          exit(0);
                         }                          }
                         break;                          break;
Line 144 
Line 143 
                         hostconv(optarg);                          hostconv(optarg);
                         addarg(HOST_TYPE, optarg);                          addarg(HOST_TYPE, optarg);
                         break;                          break;
                   case 'n':
                           maxrec = strtonum(optarg, 0, LONG_MAX, &errstr);
                           if (errstr != NULL)
                                   errx(1, "number of lines is %s: %s", errstr,
                                       optarg);
                           if (maxrec == 0)
                                   exit(0);
                           break;
                 case 's':                  case 's':
                         seconds++;                          seconds++;
                         break;                          break;
Line 646 
Line 653 
         extern char *__progname;          extern char *__progname;
   
         fprintf(stderr,          fprintf(stderr,
             "usage: %s [-#] [-csT] [-f file] [-t tty] [-h host]"              "usage: %s [-#] [-csT] [-f file] [-n #] [-t tty] [-h host]"
             " [-d [[[CC]YY]MMDD]hhmm[.SS]] [user ...]\n", __progname);              " [-d [[[CC]YY]MMDD]hhmm[.SS]] [user ...]\n", __progname);
         exit(1);          exit(1);
 }  }

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