git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Another minor cleanup involving string_lists
@ 2012-11-05  8:41 Michael Haggerty
  2012-11-05  8:41 ` [PATCH 1/2] link_alt_odb_entries(): use string_list_split_in_place() Michael Haggerty
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael Haggerty @ 2012-11-05  8:41 UTC (permalink / raw)
  To: Jeff King; +Cc: Junio C Hamano, git, Michael Haggerty

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-08 17:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-05  8:41 [PATCH 0/2] Another minor cleanup involving string_lists Michael Haggerty
2012-11-05  8:41 ` [PATCH 1/2] link_alt_odb_entries(): use string_list_split_in_place() Michael Haggerty
2012-11-05  8:41 ` [PATCH 2/2] link_alt_odb_entries(): take (char *, len) rather than two pointers Michael Haggerty
2012-11-08 17:38 ` [PATCH 0/2] Another minor cleanup involving string_lists Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).