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

Re: [PATCH] setup.c: Fix prefix_pathspec from looping pass end of string

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 8, 2013, 01:51 UTC
Message-ID
<7vk3pik6aq.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CADgNja=8f+_ORb_WStRz2grr0pYmJ2gZTnCHbOGUb3ogPPd_LQ@mail.gmail.com>
Andrew Wong <andrew.kw.w@gmail.com> writes:
Show 11 quoted lines
> 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'

What I meant was that I do not get any error _after_ applying your patch.

It is broken to behave as if "LS_COLORS=..." (which is totally unrelated string that happens to be laid out next in the memory) is a part of the pathspec magic specification your ":(top" started. Your patch makes the code stop doing that.

But it is equally broken to behave as if there is nothing wrong in the incomplete magic ":(top" that is not closed, isn't it?

Previous: Andrew WongNext: Andrew Wong
Message 6 of 9 in “setup.c: Fix prefix_pathspec from looping pass end of string”
  1. setup.c: Fix prefix_pathspec from looping pass end of stringAndrew Wong, Mar 7, 2013
  2. Junio C HamanoMar 7, 2013
  3. Andrew WongMar 7, 2013
  4. Junio C HamanoMar 7, 2013
  5. Andrew WongMar 8, 2013
  6. Junio C HamanoMar 8, 2013
  7. Andrew WongMar 8, 2013
  8. 1/2 setup.c: Fix prefix_pathspec from looping pass end of stringAndrew Wong, Mar 9, 2013
  9. 2/2 setup.c: Check that the pathspec magic ends with ")"Andrew Wong, Mar 9, 2013

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.