apply: rename free_patch() to free_patch_list()
As that is the only logical name for a function that walks a list and frees each element on it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
6fe53908f9
commit
a604ddef73
@ -198,19 +198,24 @@ struct patch {
|
|||||||
|
|
||||||
static void free_patch(struct patch *patch)
|
static void free_patch(struct patch *patch)
|
||||||
{
|
{
|
||||||
while (patch) {
|
struct fragment *fragment = patch->fragments;
|
||||||
struct patch *patch_next = patch->next;
|
|
||||||
struct fragment *fragment = patch->fragments;
|
|
||||||
|
|
||||||
while (fragment) {
|
while (fragment) {
|
||||||
struct fragment *fragment_next = fragment->next;
|
struct fragment *fragment_next = fragment->next;
|
||||||
if (fragment->patch != NULL && fragment->free_patch)
|
if (fragment->patch != NULL && fragment->free_patch)
|
||||||
free((char *)fragment->patch);
|
free((char *)fragment->patch);
|
||||||
free(fragment);
|
free(fragment);
|
||||||
fragment = fragment_next;
|
fragment = fragment_next;
|
||||||
}
|
}
|
||||||
free(patch);
|
free(patch);
|
||||||
patch = patch_next;
|
}
|
||||||
|
|
||||||
|
static void free_patch_list(struct patch *list)
|
||||||
|
{
|
||||||
|
while (list) {
|
||||||
|
struct patch *next = list->next;
|
||||||
|
free_patch(list);
|
||||||
|
list = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3771,7 +3776,7 @@ static int apply_patch(int fd, const char *filename, int options)
|
|||||||
if (summary)
|
if (summary)
|
||||||
summary_patch_list(list);
|
summary_patch_list(list);
|
||||||
|
|
||||||
free_patch(list);
|
free_patch_list(list);
|
||||||
strbuf_release(&buf);
|
strbuf_release(&buf);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user