[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-tar] Fix to sparse_diff_file when a sparse compare fails in 1.13.92
From: |
Martin Simmons |
Subject: |
[Bug-tar] Fix to sparse_diff_file when a sparse compare fails in 1.13.92 |
Date: |
Fri, 2 Jan 2004 19:41:52 +0000 (GMT) |
I've noticed that the code in sparse_diff_file calls skip_file in the success
case rather than the fail case, so never actually skips anything.
Test case (second tar should not print "Skipping to next header"):
perl -e 'open(S,">/tmp/sparse"); print S "foo"; seek S, 8192, 0; print S "foo";
close(S);'
tar -c --sparse -f /tmp/sparse.tar /tmp/sparse
perl -e 'open(S,">/tmp/sparse"); print S "bar"; seek S, 8192, 0; print S "foo";
close(S);'
tar --compare -f /tmp/sparse.tar --directory /
Patch:
--- orig/tar-1.13.92/src/sparse.c 2003-12-12 21:17:00.000000000 +0000
+++ tar-1.13.92/src/sparse.c 2003-12-27 21:05:25.000000000 +0000
@@ -489,7 +489,7 @@
+ file.stat_info->sparse_map[i].numbytes;
}
- if (rc)
+ if (!rc)
skip_file (file.stat_info->archive_file_size - file.dumped_size);
tar_sparse_done (&file);
__Martin
- [Bug-tar] Fix to sparse_diff_file when a sparse compare fails in 1.13.92,
Martin Simmons <=