aboutsummaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorDaniel Barkalow <barkalow@iabervon.org>2005-09-05 02:04:18 -0400
committerJunio C Hamano <junkio@cox.net>2005-09-10 18:27:40 -0700
commit680bab3d9a33029be38590681832ae9b6d74ad60 (patch)
tree8ca1ff411337a7abafb5c00f43250effe06b73cb /object.c
parent77675e2aff434cb1f0e62540ae42f5716a5a778d (diff)
downloadgit-680bab3d9a33029be38590681832ae9b6d74ad60.tar.gz
git-680bab3d9a33029be38590681832ae9b6d74ad60.tar.xz
[PATCH] Add function to append to an object_list.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'object.c')
-rw-r--r--object.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/object.c b/object.c
index 72f6aa552..63e6e784d 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;