Skip to content

Commit 08668f1

Browse files
committed
Merge branch 'sb/mailsplit-dead-code-removal'
* sb/mailsplit-dead-code-removal: mailsplit.c: remove dead code
2 parents 067f86f + 13b0812 commit 08668f1

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

builtin/mailsplit.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,16 @@ static int keep_cr;
5353
*/
5454
static int split_one(FILE *mbox, const char *name, int allow_bare)
5555
{
56-
FILE *output = NULL;
56+
FILE *output;
5757
int fd;
5858
int status = 0;
5959
int is_bare = !is_from_line(buf.buf, buf.len);
6060

61-
if (is_bare && !allow_bare)
62-
goto corrupt;
63-
61+
if (is_bare && !allow_bare) {
62+
unlink(name);
63+
fprintf(stderr, "corrupt mailbox\n");
64+
exit(1);
65+
}
6466
fd = open(name, O_WRONLY | O_CREAT | O_EXCL, 0666);
6567
if (fd < 0)
6668
die_errno("cannot open output file '%s'", name);
@@ -91,13 +93,6 @@ static int split_one(FILE *mbox, const char *name, int allow_bare)
9193
}
9294
fclose(output);
9395
return status;
94-
95-
corrupt:
96-
if (output)
97-
fclose(output);
98-
unlink(name);
99-
fprintf(stderr, "corrupt mailbox\n");
100-
exit(1);
10196
}
10297

10398
static int populate_maildir_list(struct string_list *list, const char *path)

0 commit comments

Comments
 (0)