*/
static void write_trailer(void)
{
- memset(block + offset, 0, RECORDSIZE);
- offset += RECORDSIZE;
+ get_record();
write_if_needed();
- memset(block + offset, 0, RECORDSIZE);
- offset += RECORDSIZE;
+ get_record();
write_if_needed();
- if (offset) {
- memset(block + offset, 0, BLOCKSIZE - offset);
- reliable_write(block, BLOCKSIZE);
- offset = 0;
+ while (offset) {
+ get_record();
+ write_if_needed();
}
}
}
/* get commit time from committer line of commit object */
-time_t commit_time(void * buffer, unsigned long size)
+static time_t commit_time(void * buffer, unsigned long size)
{
time_t result = 0;
char *p = buffer;
if (!archive_time)
archive_time = time(NULL);
if (basedir)
- write_header("0", TYPEFLAG_DIR, NULL, NULL, basedir, 040755,
- NULL, 0);
+ write_header((unsigned char *)"0", TYPEFLAG_DIR, NULL, NULL,
+ basedir, 040755, NULL, 0);
traverse_tree(buffer, size, NULL);
free(buffer);
write_trailer();