X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=fsck.c;h=6c855f84f01c19678399d85181da1094bd61b371;hb=09b90fb3c065ac5ac2ad051596b036131ecedbd5;hp=60bd4bbf6a2206e2b1991093ea5d84be7f338f73;hpb=6d1cdadbeeb03f40250526e29b1f1a91582911d8;p=git.git diff --git a/fsck.c b/fsck.c index 60bd4bbf6..6c855f84f 100644 --- a/fsck.c +++ b/fsck.c @@ -224,13 +224,15 @@ static int fsck_tree(struct tree *item, int strict, fsck_error error_func) static int fsck_ident(char **ident, struct object *obj, fsck_error error_func) { - if (**ident == '<' || **ident == '\n') - return error_func(obj, FSCK_ERROR, "invalid author/committer line - missing space before email"); - *ident += strcspn(*ident, "<\n"); - if ((*ident)[-1] != ' ') + if (**ident == '<') return error_func(obj, FSCK_ERROR, "invalid author/committer line - missing space before email"); + *ident += strcspn(*ident, "<>\n"); + if (**ident == '>') + return error_func(obj, FSCK_ERROR, "invalid author/committer line - bad name"); if (**ident != '<') return error_func(obj, FSCK_ERROR, "invalid author/committer line - missing email"); + if ((*ident)[-1] != ' ') + return error_func(obj, FSCK_ERROR, "invalid author/committer line - missing space before email"); (*ident)++; *ident += strcspn(*ident, "<>\n"); if (**ident != '>')