threads / patch / 37671

patchmailsplit: remove unnecessary unlink(2) call

Subject: [PATCH] mailsplit: remove unnecessary unlink(2) call

## tl;dr

One message between Oct 4, 2014 and Oct 4, 2014. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

René Scharfe· Oct 4, 2014, 08:41 UTC · lore

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>
---
Original thread: http://thread.gmane.org/gmane.comp.version-control.git/255140
 builtin/mailsplit.c | 1 -
 1 file changed, 1 deletion(-)
Show changes to builtin/mailsplit.c +0 −1
diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c
index 763cda0..8e02ea1 100644
--- a/builtin/mailsplit.c
+++ b/builtin/mailsplit.c
@@ -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);
 	}
-- 
2.1.2

← back to recent threads