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

Diff for /src/usr.bin/tail/tail.c between version 1.15 and 1.16

version 1.15, 2008/10/17 11:38:20 version 1.16, 2008/11/13 18:33:03
Line 132 
Line 132 
                 }                  }
         argc -= optind;          argc -= optind;
         argv += optind;          argv += optind;
   
           if (fflag && argc > 1)
                   errx(1, "-f option only appropriate for a single file");
   
         /*          /*
          * If displaying in reverse, don't permit follow option, and convert           * If displaying in reverse, don't permit follow option, and convert
          * style values.           * style values.
Line 158 
Line 162 
                         style = RLINES;                          style = RLINES;
                 }                  }
         }          }
   
         if (*argv) {  
                 if (fflag) {  
                         follow(argv, argc, style, off);  
                 }  
                 else {  
                         for (first = 1; (fname = *argv++);) {  
                                 if ((fp = fopen(fname, "r")) == NULL ||  
                                     fstat(fileno(fp), &sb)) {  
                                         ierr();  
                                         continue;  
                                 }  
                                 if (argc > 1) {  
                                         (void)printf("%s==> %s <==\n",  
                                             first ? "" : "\n", fname);  
                                         first = 0;  
                                         (void)fflush(stdout);  
                                 }  
   
                                 if (rflag)          if (*argv)
                                         reverse(fp, style, off, &sb);                  for (first = 1; (fname = *argv++);) {
                                 else                          if ((fp = fopen(fname, "r")) == NULL ||
                                         forward(fp, style, off, &sb);                              fstat(fileno(fp), &sb)) {
                                 (void)fclose(fp);                                  ierr();
                                   continue;
                         }                          }
                           if (argc > 1) {
                                   (void)printf("%s==> %s <==\n",
                                       first ? "" : "\n", fname);
                                   first = 0;
                                   (void)fflush(stdout);
                           }
   
                           if (rflag)
                                   reverse(fp, style, off, &sb);
                           else
                                   forward(fp, style, off, &sb);
                           (void)fclose(fp);
                 }                  }
         }  
         else {          else {
                 fname = "stdin";                  fname = "stdin";
                 is_stdin = 1;                  is_stdin = 1;

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16