Re: [PATCH v2 2/2] i18n: mark OPTION_NUMBER (-NUM) for translation

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

 



On Wed, Feb 6, 2013 at 11:35 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>> How about this since [PATCH v3]:
>>
>> diff --git a/utf8.c b/utf8.c
>> index 52dbd..b893a 100644
>> --- a/utf8.c
>> +++ b/utf8.c
>> @@ -443,8 +443,11 @@ int utf8_fprintf(FILE *stream, const char *format, ...)
>>         strbuf_vaddf(&buf, format, arg);
>>         va_end (arg);
>>
>> -       fputs(buf.buf, stream);
>> -       columns = utf8_strwidth(buf.buf);
>> +       columns = fputs(buf.buf, stream);
>> +       /* If no error occurs, and really write something (columns > 0),
>> +        * calculate really columns width with utf8_strwidth. */
>> +       if (columns > 0)
>> +               columns = utf8_strwidth(buf.buf);
>>         strbuf_release(&buf);
>>         return columns;
>>  }
>
> The above bugfix does not address my original concern about
> the name, though.

How about utf8_fwprintf? wprintf() deals with wide characters and
returns the number of wide characters, I think the name fits. And we
could just drop utf8_ and use the existing name, because we don't use
wchar_t* anyway.
-- 
Duy
--
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]