fix file corruption regression in 'got checkout' caused by commit db696021 got-read-pack must rewind its files temporary files before reusing them. Problem reported by naddy ok tracey naddy
diff --git a/lib/pack.c b/lib/pack.c
index 4a1a3b5..d023ca6 100644
--- a/lib/pack.c
+++ b/lib/pack.c
@@ -1123,6 +1123,11 @@ got_pack_dump_delta_chain_to_file(size_t *result_size,
return got_error_from_errno("malloc");
base_file = NULL;
accum_file = NULL;
+ } else {
+ if (fseeko(base_file, 0L, SEEK_SET) == -1)
+ return got_error_from_errno("fseeko");
+ if (fseeko(accum_file, 0L, SEEK_SET) == -1)
+ return got_error_from_errno("fseeko");
}
/* Deltas are ordered in ascending order. */