Thread View: gnu.utils.bug
1 messages
1 total messages
Started by Jim Murray
Tue, 26 Jan 1993 02:15
Bug report for tar.1.11.1
Author: 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads