From: Eric S. Raymond Date: Thu, 18 Sep 2003 23:04:56 +0000 (+0000) Subject: Correct a regression bug. X-Git-Tag: 2.1~11 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=462b3167cce1fa5206c3cdccb8e76ed4de7e61bf;p=comparator.git Correct a regression bug. --- diff --git a/main.c b/main.c index 080931c..29b2727 100644 --- a/main.c +++ b/main.c @@ -88,7 +88,7 @@ void corehook(struct hash_t hash, struct filehdr_t *file) sort_count++; } -void extend_current_chunk(void) +void extend_current_chunk(limit) /* bump the end-line number on the last chunk, if there is one */ { if (sort_count > 0) diff --git a/shred.h b/shred.h index a825bfa..1108730 100644 --- a/shred.h +++ b/shred.h @@ -63,7 +63,7 @@ extern int shredsize, minsize; extern void report_time(char *legend, ...); struct filehdr_t *register_file(const char *file, linenum_t length); extern void corehook(struct hash_t hash, struct filehdr_t *file); -extern void extend_current_chunk(void); +extern void extend_current_chunk(int); extern void dump_array(const char *legend, struct sorthash_t *obarray, int hashcount); extern void dump_flags(const int flags, FILE *fp); diff --git a/shredtree.c b/shredtree.c index dd0bb3f..4c91cfd 100644 --- a/shredtree.c +++ b/shredtree.c @@ -223,8 +223,8 @@ int shredfile(struct filehdr_t *file, * styles). This is a kluge, but it means we will capture * entire C functions that differ only by brace placement. */ - if (remove_braces && braceline && linecount < file->length) - extend_current_chunk(); + if (remove_braces && braceline) + extend_current_chunk(file->length); continue; } accepted++;