setup.c: stop prefix_pathspec() from looping past the end of string
commit805da4dee15be374b83f830ccaab98d43fd22227
authorAndrew Wong <andrew.kw.w@gmail.com>
Thu, 7 Mar 2013 16:36:03 +0000 (7 11:36 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 7 Mar 2013 21:48:39 +0000 (7 13:48 -0800)
tree32952d0ac62113394a90a8b75bb766ed2cc4421e
parent7e2010537e96d0a1144520222f20ba1dc3d61441
setup.c: stop prefix_pathspec() from looping past the end of string

The code assumes that the string ends at either `)` or `,`, and does
not handle the case where strcspn() returns length due to end of
string.  So specifying ":(top" as pathspec will cause the loop to go
past the end of string.

Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
setup.c