On Wed, Jul 10, 2013 at 9:03 PM, Eric Sunshine <[email protected]> wrote:
> +static void check_mailmap(struct string_list *mailmap, const char *contact)
> +{
> + const char *name, *mail;
> + size_t namelen, maillen;
> + struct ident_split ident;
> + char term = null_out ? '\0' : '\n';
> +
> + if (split_ident_line(&ident, contact, strlen(contact)))
> + die(_("unable to parse contact: %s"), contact);
> +
> + name = ident.name_begin;
> + namelen = ident.name_end - ident.name_begin;
> + mail = ident.mail_begin;
> + maillen = ident.mail_end - ident.mail_begin;
> +
> + map_user(mailmap, &mail, &maillen, &name, &namelen);
Would it be useful to check the return value of this function, to
display a message when the name can't mapped ?
> + if (namelen)
> + printf("%.*s <%.*s>%c",
> + (int)namelen, name, (int)maillen, mail, term);
> + else
> + printf("<%.*s>%c", (int)maillen, mail, term);
> +}
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html