Karthik Nayak <karthik....@gmail.com> writes:

> @@ -1098,6 +1099,7 @@ int parse_signed_commit(const unsigned char *sha1,
>       char *buffer = read_sha1_file(sha1, &type, &size);
>       int in_signature, saw_signature = -1;
>       char *line, *tail;
> +     const char *gpg_sig;
>  
>       if (!buffer || type != OBJ_COMMIT)
>               goto cleanup;
> @@ -1113,9 +1115,9 @@ int parse_signed_commit(const unsigned char *sha1,
>               next = next ? next + 1 : tail;
>               if (in_signature && line[0] == ' ')
>                       sig = line + 1;
> -             else if (starts_with(line, gpg_sig_header) &&
> -                      line[gpg_sig_header_len] == ' ')
> -                     sig = line + gpg_sig_header_len + 1;
> +             else if ((gpg_sig = skip_prefix(line, gpg_sig_header))
> +                       && gpg_sig[0] == ' ')
> +                     sig = gpg_sig + 1;

I am not sure if this hunk is a great improvement, as we know the
length of what we are skipping in the gpg_sig_header_len constant
that is used throughout this file.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to