Make --dirstat=0 output directories that contribute < 0.1% of changes
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index 3b40e597d5793d13944f9604e5197ac216eb3a3e..004a46b529d162fcac070796f8d91d69ef1f5310 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1502,8 +1502,8 @@ static long gather_dirstat(struct diff_options *opt, struct dirstat_dir *dir,
         *    under this directory (sources == 1).
         */
        if (baselen && sources != 1) {
-               int permille = this_dir * 1000 / changed;
-               if (permille) {
+               if (this_dir) {
+                       int permille = this_dir * 1000 / changed;
                        int percent = permille / 10;
                        if (percent >= dir->percent) {
                                fprintf(opt->file, "%s%4d.%01d%% %.*s\n", line_prefix,