Re: [PATCH v2 07/18] fsck: Make fsck_ident() warn-friendly
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
> When fsck_ident() identifies a problem with the ident, it should still
> advance the pointer to the next line so that fsck can continue in the
> case of a mere warning.
Show 24 quoted lines
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> fsck.c | 49 +++++++++++++++++++++++++++----------------------
> 1 file changed, 27 insertions(+), 22 deletions(-)
>
> diff --git a/fsck.c b/fsck.c
> index 78944f0..233385b 100644
> --- a/fsck.c
> +++ b/fsck.c
> @@ -453,40 +453,45 @@ static int require_end_of_header(const void *data, unsigned long size,
>
> static int fsck_ident(const char **ident, struct object *obj, struct fsck_options *options)
> {
> + const char *p = *ident;
> char *end;
>
> - if (**ident == '<')
> + *ident = strchrnul(*ident, '\n');
> + if (**ident == '\n')
> + (*ident)++;
> +
> + if (*p == '<')
> return report(options, obj, FSCK_MSG_MISSING_NAME_BEFORE_EMAIL, "invalid author/committer line - missing space before email");