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

Diff for /src/usr.bin/hexdump/display.c between version 1.16 and 1.17

version 1.16, 2005/08/18 17:18:24 version 1.17, 2007/01/28 16:36:17
Line 324 
Line 324 
 void  void
 doskip(const char *fname, int statok)  doskip(const char *fname, int statok)
 {  {
         int cnt;          off_t cnt;
         struct stat sb;          struct stat sb;
   
         if (statok) {          if (statok) {
                 if (fstat(fileno(stdin), &sb))                  if (fstat(fileno(stdin), &sb))
                         err(1, "fstat %s", fname);                          err(1, "fstat %s", fname);
                 if (S_ISREG(sb.st_mode) && skip >= sb.st_size) {                  if (S_ISREG(sb.st_mode)) {
                         address += sb.st_size;                          if (skip >= sb.st_size) {
                         skip -= sb.st_size;                                  address += sb.st_size;
                                   skip -= sb.st_size;
                           } else {
                                   if (fseeko(stdin, skip, SEEK_SET))
                                           err(1, "fseeko %s", fname);
                                   address += skip;
                                   skip = 0;
                           }
                         return;                          return;
                 }                  }
         }          }
         if (S_ISREG(sb.st_mode)) {  
                 if (fseeko(stdin, skip, SEEK_SET))          for (cnt = 0; cnt < skip; ++cnt)
                         err(1, "fseeko %s", fname);                  if (getchar() == EOF)
                 address += skip;                          break;
                 skip = 0;          address += cnt;
         } else {          skip -= cnt;
                 for (cnt = 0; cnt < skip; ++cnt)  
                         if (getchar() == EOF)  
                                 break;  
                 address += cnt;  
                 skip -= cnt;  
         }  
 }  }
   
 void *  void *

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