summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-09-09 12:54:04 -0700
committerJunio C Hamano <gitster@pobox.com>2014-09-09 12:54:04 -0700
commit08668f18021e12d7c86b8384011465832dbd0a41 (patch)
tree44d4337f3cecbee5c17450173a3509dbff8d5206
parent067f86fe12d1d9a9a1a962f7d82b1e84adc3120a (diff)
parent13b081257a6c996e6c62316be1d1a6f615514ed2 (diff)
downloadgit-08668f18021e12d7c86b8384011465832dbd0a41.tar.gz
Merge branch 'sb/mailsplit-dead-code-removal'
* sb/mailsplit-dead-code-removal: mailsplit.c: remove dead code
-rw-r--r--builtin/mailsplit.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c
index 06296d4bdf..763cda098c 100644
--- a/builtin/mailsplit.c
+++ b/builtin/mailsplit.c
@@ -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);
@@ -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)