From 583e91e9beca022b48a44e9fdc48dc287b1e6eb9 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 2 Sep 2003 20:52:30 +0000 Subject: [PATCH] We're merged. Now clean up. --- main.c | 13 +++++++++++-- report.c | 2 +- shredtree.c | 4 ++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index f701b5e..69a1ea7 100644 --- a/main.c +++ b/main.c @@ -22,6 +22,8 @@ static void filehook(struct hash_t hash, const char *file) chunk_buffer = (struct hash_t *)realloc(chunk_buffer, sizeof(struct hash_t) * (chunk_count+1)); + hash.start = TONET(hash.start); + hash.end = TONET(hash.end); chunk_buffer[chunk_count++] = hash; } @@ -47,7 +49,7 @@ static void generate_shredfile(const char *tree, FILE *ofp) list = sorted_file_list(tree, &file_count); fputs("#SHIF-A 1.0\n", ofp); - fputs("Generator-Program: shredtree 1.0\n", ofp); + fputs("Generator-Program: comparator 1.0\n", ofp); fputs("Hash-Method: MD5\n", ofp); fprintf(ofp, "Normalization: %s\n", rws ? "remove_whitespace" : "none"); fprintf(ofp, "Shred-Size: %d\n", shredsize); @@ -173,12 +175,19 @@ main(int argc, char *argv[]) generate_shredfile(argv[optind], stdout); else if (exec_direct) { + struct shif_t localblock; + + localblock.hash_method = "MD5"; + localblock.normalization = rws ? "remove_whitespace" : "none"; + localblock.shred_size = shredsize; + localblock.generator_program = "comparator 1.0"; + report_time(NULL); generate_shredlist(argc-optind, argv+optind); report_time("Hash merge done, %d entries", sort_count); sort_hashes(sort_buffer, sort_count); report_time("Sort done"); - emit_report(NULL, sort_buffer, sort_count); + emit_report(&localblock, sort_buffer, sort_count); } else { diff --git a/report.c b/report.c index a69c612..5a7735f 100644 --- a/report.c +++ b/report.c @@ -448,7 +448,7 @@ void emit_report(struct shif_t *shif, puts("#SHIF-B 1.0"); printf("Hash-Method: %s\n", shif->hash_method); - puts("Merge-Program: shredcompare 1.0"); + puts("Merge-Program: comparator 1.0"); printf("Normalization: %s\n", shif->normalization); printf("Shred-Size: %d\n", shif->shred_size); puts("%%"); diff --git a/shredtree.c b/shredtree.c index 8617125..39f5c1a 100644 --- a/shredtree.c +++ b/shredtree.c @@ -102,8 +102,8 @@ static struct hash_t emit_chunk(shred *display, int linecount) if (display[i].line) firstline = i; firstline = display[firstline].number; - out.start = TONET(firstline); - out.end = TONET(linecount); + out.start = firstline; + out.end = linecount; return(out); } -- 2.43.0