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

Re: [PATCH] log-tree: fix patch filename computation in "git format-patch"

From
Stephen Boyd <bebarino@gmail.com>
Date
Mar 27, 2009, 04:31 UTC
Message-ID
<780e0a6b0903262131l26e9ea6ua3289925fd322d93@mail.gmail.com>
In-Reply-To
<7v3acziot0.fsf@gitster.siamese.dyndns.org>
On Thu, Mar 26, 2009 at 9:15 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
>
> Shouldn't it be just:
>
>        size_t max_len = start_len + FORMAT_PATCH_NAME_MAX - suffix_len;
>        if (max_len < buf->len)
>                strbuf_setlen(buf, max_len);
>        strbuf_addstr(buf, suffix);
Yes, this is good.
Show 5 quoted lines
>
> The caller must make sure that suffix_len is sufficiently shorter than
> FORMAT_PATCH_NAME_MAX; I do not know if the current code does that,
> though.
>
The original code never did this. What should happen in this case?
I am away on travel this week, so I won't be able to update this until Monday.

Thanks, Stephen

Previous: Junio C HamanoNext: Christian Couder
Message 3 of 4 in “log-tree: fix patch filename computation in "git format-patch"”
  1. log-tree: fix patch filename computation in "git format-patch"Christian Couder, Mar 27, 2009
  2. Junio C HamanoMar 27, 2009
  3. Stephen BoydMar 27, 2009
  4. Christian CouderMar 27, 2009

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.