Skip to content

Commit

Permalink
Merge branch 'sb/mailsplit-dead-code-removal'
Browse files Browse the repository at this point in the history
* sb/mailsplit-dead-code-removal:
  mailsplit.c: remove dead code
  • Loading branch information
Junio C Hamano committed Sep 9, 2014
2 parents 067f86f + 13b0812 commit 08668f1
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions builtin/mailsplit.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ static int keep_cr;
*/
static int split_one(FILE *mbox, const char *name, int allow_bare)
{
FILE *output = NULL;
FILE *output;
int fd;
int status = 0;
int is_bare = !is_from_line(buf.buf, buf.len);

if (is_bare && !allow_bare)
goto corrupt;

if (is_bare && !allow_bare) {
unlink(name);
fprintf(stderr, "corrupt mailbox\n");
exit(1);
}
fd = open(name, O_WRONLY | O_CREAT | O_EXCL, 0666);
if (fd < 0)
die_errno("cannot open output file '%s'", name);
Expand Down Expand Up @@ -91,13 +93,6 @@ static int split_one(FILE *mbox, const char *name, int allow_bare)
}
fclose(output);
return status;

corrupt:
if (output)
fclose(output);
unlink(name);
fprintf(stderr, "corrupt mailbox\n");
exit(1);
}

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

0 comments on commit 08668f1

Please sign in to comment.