git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH 0/2] Another minor cleanup involving string_lists
Date: Thu, 8 Nov 2012 12:38:35 -0500	[thread overview]
Message-ID: <20121108173835.GH15560@sigill.intra.peff.net> (raw)
In-Reply-To: <1352104883-21053-1-git-send-email-mhagger@alum.mit.edu>

On Mon, Nov 05, 2012 at 09:41:21AM +0100, Michael Haggerty wrote:

> 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).

Thanks, the new version is much easier on the eyes.

> 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.

I don't think it's worth worrying about. Given that the entries must be
absolute paths anyway, we do not even have to worry about an insane path
starting with "#".

-Peff

      parent reply	other threads:[~2012-11-08 17:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Jeff King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121108173835.GH15560@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mhagger@alum.mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).