From: Francois Fleuret Date: Fri, 12 Mar 2010 06:59:08 +0000 (+0100) Subject: Cosmetics. X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=finddup.git;a=commitdiff_plain;h=9b4c525f5b820a47d15f99bcd07ca83a1847ee89 Cosmetics. --- diff --git a/finddup.c b/finddup.c index 0799503..688fb02 100644 --- a/finddup.c +++ b/finddup.c @@ -342,7 +342,7 @@ void print_progress(int max, int n, int *pp) { int width; if(show_progress && tty_width > 0) { width = tty_width - 7; - p = (width * n) / max; + p = (width * n) / (max - 1); if(p > *pp) { for(k = 0; k < p; k++) { fprintf(stderr, "+"); @@ -351,8 +351,8 @@ void print_progress(int max, int n, int *pp) { fprintf(stderr, "-"); } *pp = p; - p = (100 * n) / max; - fprintf(stderr, " [% 3d%%]\r", p); + p = (100 * n) / (max - 1); + fprintf(stderr, " [%3d%%]\r", p); } } } @@ -377,8 +377,7 @@ void start(const char *dirname1, const char *dirname2) { if(dirname2) { if(strncmp(dirname2, "not:", 4) == 0) { not_in = 1; - /* We should show groups even in that mode. However they are not - properly calculated for now, so we force it off. */ + /* groups are not computed in the not: mode */ show_groups = 0; dirname2 += 4; }