Skip to contentSkip to conversation

mailsplit: remove unnecessary unlink(2) call

PATCH New René Scharfe 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mailsplit: remove unnecessary unlink(2) call

The output file hasn't been created at this point, yet, so there is no need to delete it when exiting early.

---
Original thread: http://thread.gmane.org/gmane.comp.version-control.git/255140

 builtin/mailsplit.c | 1 -
 1 file changed, 1 deletion(-)
builtin/mailsplit.c +0 -1
index 763cda0..8e02ea1 100644
@@ -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);
 	}
Signature · 1 line
2.1.2