From: Eric S. Raymond Date: Wed, 10 Sep 2003 07:03:44 +0000 (+0000) Subject: Add c-normalization to the format. X-Git-Tag: 1.2~5 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=684d45fc0945734ac12788f27896dfff2592f1a7;p=comparator.git Add c-normalization to the format. --- diff --git a/main.c b/main.c index 752df1a..e1be40d 100644 --- a/main.c +++ b/main.c @@ -76,13 +76,23 @@ static void write_scf(const char *tree, FILE *ofp) char **place, **list; int file_count; u_int32_t netfile_count; + char buf[BUFSIZ]; list = sorted_file_list(tree, &file_count); fputs("#SCF-A 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"); + buf[0] = '\0'; + if (rws) + strcat(buf, "remove-whitespace,"); + if (c_normalization) + strcat(buf, "c-normalization,"); + if (buf[0]) + buf[strlen(buf)-1] = '\0'; + else + strcpy(buf, "none"); + fprintf(ofp, "Normalization: %s\n", buf); fprintf(ofp, "Shred-Size: %d\n", shredsize); fputs("%%\n", ofp);