Merge pull request #196 from gsmcmullin/target_order
target: Add new targets to end of list.
This commit is contained in:
commit
38705dc952
|
@ -29,8 +29,14 @@ target *target_list = NULL;
|
||||||
target *target_new(void)
|
target *target_new(void)
|
||||||
{
|
{
|
||||||
target *t = (void*)calloc(1, sizeof(*t));
|
target *t = (void*)calloc(1, sizeof(*t));
|
||||||
t->next = target_list;
|
if (target_list) {
|
||||||
target_list = t;
|
target *c = target_list;
|
||||||
|
while (c->next)
|
||||||
|
c = c->next;
|
||||||
|
c->next = t;
|
||||||
|
} else {
|
||||||
|
target_list = t;
|
||||||
|
}
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue