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

Diff for /src/usr.bin/less/filename.c between version 1.25 and 1.26

version 1.25, 2016/09/17 15:06:41 version 1.26, 2017/10/29 17:10:55
Line 363 
Line 363 
 }  }
   
 /*  /*
  * Try to determine the size of a file by seeking to the end.  
  */  
 static off_t  
 seek_filesize(int f)  
 {  
         off_t spos;  
   
         spos = lseek(f, (off_t)0, SEEK_END);  
         if (spos == (off_t)-1)  
                 return (-1);  
         return (spos);  
 }  
   
 /*  
  * Read a string from a file.   * Read a string from a file.
  * Return a pointer to the string in memory.   * Return a pointer to the string in memory.
  */   */
Line 742 
Line 728 
   
 /*  /*
  * Return the size of a file, as cheaply as possible.   * Return the size of a file, as cheaply as possible.
  * In Unix, we can stat the file.  
  */   */
 off_t  off_t
 filesize(int f)  filesize(int f)
Line 751 
Line 736 
   
         if (fstat(f, &statbuf) >= 0)          if (fstat(f, &statbuf) >= 0)
                 return (statbuf.st_size);                  return (statbuf.st_size);
         return (seek_filesize(f));          return (-1);
 }  }
   
 /*  /*

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26