dir: remove PATH_MAX limitation
authorKarsten Blees <karsten.blees@gmail.com>
Fri, 4 Jul 2014 22:42:29 +0000 (00:42 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Jul 2014 18:31:15 +0000 (11:31 -0700)
commitd3ccb7dd53f24cf9131490cf4e223d76b4e68723
tree176ae5ae5c52be0153b8d09380b1a05a8aa6b804
parente7c730530065fb2f366ecbcb1e71d7f7346b6a25
dir: remove PATH_MAX limitation

'git status' segfaults if a directory is longer than PATH_MAX, because
processing .gitignore files in prep_exclude() writes past the end of a
PATH_MAX-bounded buffer.

Remove the limitation by using strbuf instead.

Note: this fix just 'abuses' strbuf as string allocator, len is always 0.
prep_exclude() can probably be simplified using more strbuf APIs.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.c
dir.h