Re: [PATCH/WIP 6/8] am: extract patch, message and authorship with git-mailinfo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 28, 2015 at 6:13 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Paul Tan <pyokagan@xxxxxxxxx> writes:
>
>> +static const char *msgnum(const struct am_state *state)
>> +{
>> +     static struct strbuf fmt = STRBUF_INIT;
>> +     static struct strbuf sb = STRBUF_INIT;
>> +
>> +     strbuf_reset(&fmt);
>> +     strbuf_addf(&fmt, "%%0%dd", state->prec);
>> +
>> +     strbuf_reset(&sb);
>> +     strbuf_addf(&sb, fmt.buf, state->cur);
>
> Hmph, wouldn't ("%*d", state->prec, state->cur) work or am I missing
> something?

Yeah, I think it would. I justs didn't know about the existence of '*'.

Thanks,
Paul
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]