X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=object.c;h=63e6e784d41ef5aa7bb387a96a85bf0f8e7248ab;hb=6511cce24b932eba33d8e13b54664673121a8b7e;hp=72f6aa552f79edcd5f4f5c4a647ab62503365b1b;hpb=379955c696a417f0fb6118f2fd91dbffd2816ad1;p=git.git diff --git a/object.c b/object.c index 72f6aa55..63e6e784 100644 --- a/object.c +++ b/object.c @@ -184,6 +184,17 @@ struct object_list *object_list_insert(struct object *item, return new_list; } +void object_list_append(struct object *item, + struct object_list **list_p) +{ + while (*list_p) { + list_p = &((*list_p)->next); + } + *list_p = xmalloc(sizeof(struct object_list)); + (*list_p)->next = NULL; + (*list_p)->item = item; +} + unsigned object_list_length(struct object_list *list) { unsigned ret = 0;