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

Re: [PATCH 1/3] version: refactor strbuf_sanitize()

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jun 19, 2024, 18:40 UTC
Message-ID
<CAPig+cT4PUUH5XCvmioYA-M=bOTed5jM08MpruScOZyvk8VVnw@mail.gmail.com>
In-Reply-To
<20240619125708.3719150-2-christian.couder@gmail.com>

On Wed, Jun 19, 2024 at 8:57 AM Christian Couder <christian.couder@gmail.com> wrote:

Show 15 quoted lines
> The git_user_agent_sanitized() function performs some sanitizing to
> avoid special characters being sent over the line and possibly messing
> up with the protocol or with the parsing on the other side.
>
> Let's extract this sanitizing into a new strbuf_sanitize() function, as
> we will want to reuse it in a following patch.
>
> For now the new strbuf_sanitize() function is still static as it's only
> needed locally.
>
> While at it, let's also make a few small improvements:
>   - use 'size_t' for 'i' instead of 'int',
>   - move the declaration of 'i' inside the 'for ( ... )',
>   - use strbuf_detach() to explicitely detach the string contained by
>     the 'buf' strbuf.
s/explicitely/explicitly/
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Previous: Christian CouderNext: Christian Couder
Message 3 of 22 in “Advertise OS version”
  1. 0/3 Advertise OS versionChristian Couder, Jun 19, 2024
  2. 1/3 version: refactor strbuf_sanitize()Christian Couder, Jun 19, 2024
  3. Eric SunshineJun 19, 2024
  4. 2/3 version: refactor get_uname_info()Christian Couder, Jun 19, 2024
  5. 3/3 connect: advertise OS versionChristian Couder, Jun 19, 2024
  6. Dragan SimicJun 19, 2024
  7. Jeff KingJun 19, 2024
  8. Dragan SimicJun 19, 2024
  9. Christian CouderJun 19, 2024
  10. Dragan SimicJun 19, 2024
  11. rsbecker@nexbridge.comJun 19, 2024
  12. Jeff KingJun 19, 2024
  13. rsbecker@nexbridge.comJun 19, 2024
  14. Dragan SimicJun 19, 2024
  15. Jeff KingJun 19, 2024
  16. rsbecker@nexbridge.comJun 19, 2024
  17. brian m. carlsonJun 19, 2024
  18. Jeff KingJun 20, 2024
  19. Junio C HamanoJun 20, 2024
  20. Usman AkinyemiDec 9, 2024
  21. rsbecker@nexbridge.comDec 9, 2024
  22. Usman AkinyemiDec 10, 2024

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.