Code

Use the asyncronous function infrastructure to run the content filter.
[git.git] / builtin-mailsplit.c
index 97ae004ab7939f565733e463a2b53afd63eff9df..43fc373a15cbe935054b47f9bd67c04ecf216e4e 100644 (file)
@@ -159,8 +159,8 @@ out:
        return ret;
 }
 
-int split_mbox(const char *file, const char *dir, int allow_bare,
-               int nr_prec, int skip)
+static int split_mbox(const char *file, const char *dir, int allow_bare,
+                     int nr_prec, int skip)
 {
        char name[PATH_MAX];
        int ret = -1;
@@ -261,7 +261,8 @@ int cmd_mailsplit(int argc, const char **argv, const char *prefix)
                                error("cannot split patches from stdin");
                                return 1;
                        }
-                       num += ret;
+                       num += (ret - nr);
+                       nr = ret;
                        continue;
                }
 
@@ -279,7 +280,8 @@ int cmd_mailsplit(int argc, const char **argv, const char *prefix)
                        error("cannot split patches from %s", arg);
                        return 1;
                }
-               num += ret;
+               num += (ret - nr);
+               nr = ret;
        }
 
        printf("%d\n", num);