OSDN Git Service

mailsplit: remove unnecessary unlink(2) call
authorRené Scharfe <l.s.r@web.de>
Sat, 4 Oct 2014 08:41:13 +0000 (10:41 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 7 Oct 2014 17:49:57 +0000 (10:49 -0700)
The output file hasn't been created at this point, yet, so there is no
need to delete it when exiting early.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/mailsplit.c

index 763cda0..8e02ea1 100644 (file)
@@ -59,7 +59,6 @@ static int split_one(FILE *mbox, const char *name, int allow_bare)
        int is_bare = !is_from_line(buf.buf, buf.len);
 
        if (is_bare && !allow_bare) {
-               unlink(name);
                fprintf(stderr, "corrupt mailbox\n");
                exit(1);
        }