Junio C Hamano <gitster@xxxxxxxxx> writes: >> + } else { >> + /* For an element in longhand form, we simply copy everything up to the final ')' */ > > A comment that is a bit on the overly-long side. > >> + int len = strchr(element, ')') - element; >> + strbuf_add(sb, element, len); In practice, nobody sane would write a pathspec magic that is over 2GB in size, so this would not matter unless we are facing a potential attacker, but as the third parameter strbuf_add() takes is of type size_t, it would not hurt to define "len" as the same type as well. > Thanks for working on fixing this rather old bug. I think we should > have noticed when we added the support for the "attr" magic to the > pathspec API.