Re: [PATCH] setup.c: Fix prefix_pathspec from looping pass end of string
- From
Andrew Wong <andrew.kw.w@gmail.com>
- Date
- Mar 8, 2013, 00:25 UTC
- Message-ID
- <CADgNja=8f+_ORb_WStRz2grr0pYmJ2gZTnCHbOGUb3ogPPd_LQ@mail.gmail.com>
- In-Reply-To
- <7vvc92kbho.fsf@alter.siamese.dyndns.org>
On 3/7/13, Junio C Hamano <gitster@pobox.com> wrote:
> This did not error out for me, though. > > $ cd t && git ls-files ":(top"
No error message at all? Hm, maybe in your case, the byte after the end of string happens to be '\0' and the loop ended by chance?
git doesn't crash for me, but it generates this error:
$ git ls-files ":(top"
fatal: Invalid pathspec magic 'LS_COLORS=' in ':(top'The loop runs for a second time after parsing "top", and copyfrom now
points to the byte after ":(top", which is coming from argv. And in my
distribution/platform, it looks like the envp, the third param of
main(), is packed right after the argv strings, because:
$ env | head -n 1
LS_COLORS=