Article View: gnu.utils.bug
Article #1334Bug report for tar.1.11.1
From: Jim Murray
Date: Tue, 26 Jan 1993 02:15
Date: Tue, 26 Jan 1993 02:15
53 lines
2091 bytes
2091 bytes
I found two problems with the handling of sparse files in tar-1.11.1.
The first is that if there were exactly 26 elements in sparsearray
only 25 would be written out leading to any number of possible error
messages depending on the first few bytes of the data in the file.
The second problem is that if the file ends in a block of 0's the
last byte is not written so the file is left with the wrong size.
I decided to fix this in create rather than extract. The fix is
that if amidst_data is not set at eof put out a block with just the
last byte of the file.
Jim
*** ../tar-1.11.1/create.c Mon Sep 14 17:19:28 1992
--- create.c Mon Jan 25 15:33:55 1993
***************
*** 516,522 ****
/* sum += i;
if (sum < upperbound)
goto extend;*/
! if (index_offset+i < upperbound) {
index_offset += i;
exhdr->ext_hdr.isextended++;
goto extend;
--- 518,524 ----
/* sum += i;
if (sum < upperbound)
goto extend;*/
! if (index_offset+i <= upperbound) {
index_offset += i;
exhdr->ext_hdr.isextended++;
goto extend;
***************
*** 1045,1050 ****
--- 1047,1057 ----
}
if (amidst_data)
sparsearray[sparse_ind++].numbytes = numbytes;
+ else
+ {
+ sparsearray[sparse_ind].offset = offset-1;
+ sparsearray[sparse_ind++].numbytes = 1;
+ }
close(fd);
return sparse_ind - 1;
--
Jim Murray INET jjm%jjmhome@stratus.com
2 Mohawk Circle SMART UUCP jjm@jjmhome.uucp
Westboro Mass 01581 uunet!lectroid!jjmhome!jjm
USA voice (508) 366-2813
Technical Details
Message-ID:
<m0nGbd0-0002uGC@jjmhome.uucp>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!jjmhome.UUCP!jjmShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!jjmhome.UUCP!jjm From: jjm@jjmhome.UUCP (Jim Murray) Newsgroups: gnu.utils.bug Subject: Bug report for tar.1.11.1 Date: 25 Jan 1993 21:15:59 -0500 Organization: GNUs Not Usenet Lines: 54 Sender: daemon@cis.ohio-state.edu Approved: bug-gnu-utils@prep.ai.mit.edu Distribution: gnu Message-ID: <m0nGbd0-0002uGC@jjmhome.uucp>