Re: [PATCH] builtin-tag.c: remove global variable to use the callback data of git-config.
- From
- Carlos Rica <jasampler@gmail.com>
- Date
- Mar 17, 2009, 17:57 UTC
- Message-ID
- <1b46aba20903171057r4fb4697eo3b8abc62a45fe858@mail.gmail.com>
- In-Reply-To
- <alpine.DEB.1.00.0903171646140.6393@intel-tinevez-2-302>
On Tue, Mar 17, 2009 at 4:47 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 15 quoted lines
> Hi,
> On Tue, 17 Mar 2009, Carlos Rica wrote:
>> @@ -164,11 +162,10 @@ static int do_sign(struct strbuf *buffer)
>> int len;
>> int i, j;
>>
>> - if (!*signingkey) {
>> - if (strlcpy(signingkey, git_committer_info(IDENT_ERROR_ON_NO_NAME),
>> - sizeof(signingkey)) > sizeof(signingkey) - 1)
>> - return error("committer info too long.");
>> - bracket = strchr(signingkey, '>');
>> + if (!signingkey->buf[0]) {
>
> It is probably better to ask for !signingkey->len (think of trying to
> understand the code in 6 months from now).I was in doubt here. By avoiding the use of signingkey->len I was trying to say that you cannot rely in such field if we touch the buffer directly, as it happens below:
bracket = strchr(signingkey->buf, '>');
if (bracket)
bracket[1] = '\0';