]> thyrsus.com Git - comparator.git/commitdiff
We're merged. Now clean up.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 2 Sep 2003 20:52:30 +0000 (20:52 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 2 Sep 2003 20:52:30 +0000 (20:52 +0000)
main.c
report.c
shredtree.c

diff --git a/main.c b/main.c
index f701b5ecc8a167c3757dc1193a45a626dbe43d2c..69a1ea7d76e9a4f3146431deaa3cffaa16c50b12 100644 (file)
--- 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
     {
index a69c612a9b06e091a182b2658a0d27f05c44a17b..5a7735f2aa8509f7f0f8102d48c1896c09972681 100644 (file)
--- 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("%%");
index 86171254a171eb034dbbabb068b240b7cdbdf092..39f5c1ae12dda7be6692ce8cec6f971289ee928b 100644 (file)
@@ -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);
 }