git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Broken interactive rebase text after some UTF-8 characters

From
Alban Gruin <alban.gruin@gmail.com>
Date
Feb 1, 2019, 16:13 UTC
Message-ID
<a3f4a6d2-7461-709a-6d1a-097785bb8664@gmail.com>
In-Reply-To
<nycvar.QRO.7.76.6.1902010835210.41@tvgsbejvaqbjf.bet>
Hi Johannes,
Le 01/02/2019 à 08:38, Johannes Schindelin a écrit :
Show 32 quoted lines
> Hi,
> 
> On Thu, 31 Jan 2019, Junio C Hamano wrote:
> 
>> Phillip Wood <phillip.wood@talktalk.net> writes:
>>
>>>> Are we misusing C formats?
>>>
>>> The C standard and POSIX both say that the * refers to the maximum
>>> number of bytes to print but it looks like it is being treated as the
>>> maximum number of characters on OpenIndiana.
>>>
>>> Johannes - Perhaps we should change it to use fwrite() unless printf()
>>> gets fixed and we're sure no other operating systems are affected?
>>
>> Avoid such a rewrite, as "%*.s" that takes (int, char *) are used in
>> many other places in our codebase, if you can.
> 
> Yes, this would be painful in particular in cases like
> 
> 	master:advice.c:101:           fprintf(stderr, _("%shint: %.*s%s\n"),
> 
> where we want to write more than just a variable-length buffer.
> 
> I am curious: is libintl (gettext) used on OpenIndiana? I ask because
> AFAIR fprintf() is overridden in that case, and the bug might be a lot
> easier to fix if it is in libintl rather than in libc.
> 
> Of course, it might *still* be a bug in libc by virtue of handing '%.*s'
> through to libc's implementation.
> 
> Alban, can you test this with NO_GETTEXT?
Sure. :)

The bug no longer happens when git is built with NO_GETTEXT. All is working as expected.

> 
> Thanks,
> Johannes
> 

Cheers, Alban

Previous: Alban Gruin
Message 16 of 16 in “Broken interactive rebase text after some UTF-8 characters”
  1. Michal NowakJan 15, 2019
  2. Phillip WoodJan 16, 2019
  3. Michal NowakJan 16, 2019
  4. Phillip WoodJan 17, 2019
  5. Alban GruinJan 31, 2019
  6. Phillip WoodJan 31, 2019
  7. Alban GruinJan 31, 2019
  8. Junio C HamanoJan 31, 2019
  9. Johannes SchindelinFeb 1, 2019
  10. Michal NowakFeb 1, 2019
  11. Johannes SchindelinFeb 1, 2019
  12. Michal NowakFeb 1, 2019
  13. Junio C HamanoFeb 1, 2019
  14. Michal NowakFeb 1, 2019
  15. Alban GruinFeb 1, 2019
  16. Alban GruinFeb 1, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.