home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / utils / bug / 2471 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  2.0 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!jjmhome.UUCP!jjm
  2. From: jjm@jjmhome.UUCP (Jim Murray)
  3. Newsgroups: gnu.utils.bug
  4. Subject: Bug report for tar.1.11.1
  5. Date: 25 Jan 1993 21:15:59 -0500
  6. Organization: GNUs Not Usenet
  7. Lines: 54
  8. Sender: daemon@cis.ohio-state.edu
  9. Approved: bug-gnu-utils@prep.ai.mit.edu
  10. Distribution: gnu
  11. Message-ID: <m0nGbd0-0002uGC@jjmhome.uucp>
  12.  
  13. I found two problems with the handling of sparse files in tar-1.11.1.
  14. The first is that if there were exactly 26 elements in sparsearray
  15. only 25 would be written out leading to any number of possible error
  16. messages depending on the first few bytes of the data in the file.
  17.  
  18. The second problem is that if the file ends in a block of 0's the
  19. last byte is not written so the file is left with the wrong size.
  20. I decided to fix this in create rather than extract.  The fix is
  21. that if amidst_data is not set at eof put out a block with just the
  22. last byte of the file.
  23.  
  24. Jim
  25.  
  26.  
  27. *** ../tar-1.11.1/create.c    Mon Sep 14 17:19:28 1992
  28. --- create.c    Mon Jan 25 15:33:55 1993
  29. ***************
  30. *** 516,522 ****
  31.   /*            sum += i;
  32.               if (sum < upperbound)
  33.                   goto extend;*/
  34. !             if (index_offset+i < upperbound) {
  35.                   index_offset += i;
  36.                   exhdr->ext_hdr.isextended++;
  37.                   goto extend;
  38. --- 518,524 ----
  39.   /*            sum += i;
  40.               if (sum < upperbound)
  41.                   goto extend;*/
  42. !             if (index_offset+i <= upperbound) {
  43.                   index_offset += i;
  44.                   exhdr->ext_hdr.isextended++;
  45.                   goto extend;
  46. ***************
  47. *** 1045,1050 ****
  48. --- 1047,1057 ----
  49.       }
  50.       if (amidst_data)
  51.               sparsearray[sparse_ind++].numbytes = numbytes;
  52. +     else
  53. +     {
  54. +         sparsearray[sparse_ind].offset = offset-1;
  55. +             sparsearray[sparse_ind++].numbytes = 1;
  56. +     }
  57.       close(fd);
  58.   
  59.       return sparse_ind - 1;
  60.  
  61. -- 
  62. Jim Murray              INET        jjm%jjmhome@stratus.com
  63. 2 Mohawk Circle         SMART UUCP  jjm@jjmhome.uucp
  64. Westboro Mass 01581                 uunet!lectroid!jjmhome!jjm
  65. USA                                 voice (508) 366-2813
  66.  
  67.