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

Diff for /src/usr.bin/vim/Attic/memfile.c between version 1.1 and 1.2

version 1.1, 1996/09/07 21:40:26 version 1.2, 1996/09/21 06:23:07
Line 130 
Line 130 
 {  {
         MEMFILE                 *mfp;          MEMFILE                 *mfp;
         int                             i;          int                             i;
         long                    size;          off_t                   size;
 #ifdef UNIX  #ifdef UNIX
         struct STATFS   stf;          struct STATFS   stf;
 #endif  #endif
Line 346 
Line 346 
         mf_ins_used(mfp, hp);          mf_ins_used(mfp, hp);
         mf_ins_hash(mfp, hp);          mf_ins_hash(mfp, hp);
   
           /*
            * Init the data to all zero, to avoid reading uninitialized data.
            * This also avoids that the passwd file ends up in the swap file!
            */
           (void)vim_memset((char *)(hp->bh_data), 0, (size_t)mfp->mf_page_size);
   
         return hp;          return hp;
 }  }
   
Line 847 
Line 853 
         MEMFILE         *mfp;          MEMFILE         *mfp;
         BHDR            *hp;          BHDR            *hp;
 {  {
         long_u          offset;          off_t           offset;
         unsigned        page_size;          unsigned        page_size;
         unsigned        size;          unsigned        size;
   
Line 857 
Line 863 
         page_size = mfp->mf_page_size;          page_size = mfp->mf_page_size;
         offset = page_size * hp->bh_bnum;          offset = page_size * hp->bh_bnum;
         size = page_size * hp->bh_page_count;          size = page_size * hp->bh_page_count;
         if ((long_u)lseek(mfp->mf_fd, offset, SEEK_SET) != offset)          if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset)
         {          {
                 EMSG("Seek error in swap file read");                  EMSG("Seek error in swap file read");
                 return FAIL;                  return FAIL;
Line 880 
Line 886 
         MEMFILE         *mfp;          MEMFILE         *mfp;
         BHDR            *hp;          BHDR            *hp;
 {  {
         long_u          offset;         /* offset in the file */          off_t           offset;         /* offset in the file */
         blocknr_t       nr;                     /* block nr which is being written */          blocknr_t       nr;                     /* block nr which is being written */
         BHDR            *hp2;          BHDR            *hp2;
         unsigned        page_size;      /* number of bytes in a page */          unsigned        page_size;      /* number of bytes in a page */
Line 914 
Line 920 
                         hp2 = hp;                          hp2 = hp;
   
                 offset = page_size * nr;                  offset = page_size * nr;
                 if ((long_u)lseek(mfp->mf_fd, offset, SEEK_SET) != offset)                  if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset)
                 {                  {
                         EMSG("Seek error in swap file write");                          EMSG("Seek error in swap file write");
                         return FAIL;                          return FAIL;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2