refdb_fs: Only strstr the traits line

This commit is contained in:
Vicent Marti 2013-05-02 17:48:49 +02:00
parent 1022db2b68
commit 822645f629

View File

@ -216,8 +216,13 @@ static int packed_load(refdb_fs_backend *backend)
static const char *traits_header = "# pack-refs with: ";
if (git__prefixcmp(buffer_start, traits_header) == 0) {
const char *traits = buffer_start + strlen(traits_header);
const char *traits_end = strchr(traits, '\n');
char *traits = (char *)buffer_start + strlen(traits_header);
char *traits_end = strchr(traits, '\n');
if (traits_end == NULL)
goto parse_failed;
*traits_end = '\0';
if (strstr(traits, " fully-peeled ") != NULL) {
backend->peeling_mode = PEELING_FULL;