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

[PATCH 0/2] Another minor cleanup involving string_lists

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Nov 5, 2012, 08:41 UTC
Message-ID
<1352104883-21053-1-git-send-email-mhagger@alum.mit.edu>

Nothing really earthshattering here. But it's funny how every time I look closely at a site where I think string_lists could be used, I find problems with the old code. In this case is_absolute_path() is called with an argument that is not a null-terminated string, which is incorrect (though harmless because the function only looks at the first two bytes of the string).

Another peculiarity of the (old and new) code is that it rejects "comments" even in paths taken from the colon-separated environment variable GIT_ALTERNATE_OBJECT_DIRECTORIES. The fix would be to change link_alt_odb_entries() to take a string_list and let the callers strip out comments when appropriate. But it didn't seem worth the extra code.

Michael Haggerty (2):
  link_alt_odb_entries(): use string_list_split_in_place()
  link_alt_odb_entries(): take (char *, len) rather than two pointers
 sha1_file.c | 50 ++++++++++++++++++++++----------------------------
 1 file changed, 22 insertions(+), 28 deletions(-)
-- 
1.8.0
Next: Michael Haggerty
Message 1 of 4 in “Another minor cleanup involving string_lists”
  1. 0/2 Another minor cleanup involving string_listsMichael Haggerty, Nov 5, 2012
  2. 1/2 link_alt_odb_entries(): use string_list_split_in_place()Michael Haggerty, Nov 5, 2012
  3. 2/2 link_alt_odb_entries(): take (char *, len) rather than two pointersMichael Haggerty, Nov 5, 2012
  4. Jeff KingNov 8, 2012

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.