From 27a399729245ab082e8f76985d4cccb363ad82bb Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 5 Aug 2004 12:13:41 +0000 Subject: [PATCH] New attributes are now added at the end of the list. --- lib/object.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/object.c b/lib/object.c index 6091d1d7..ab882c12 100644 --- a/lib/object.c +++ b/lib/object.c @@ -158,14 +158,17 @@ obj_set_attr_num(struct odes *o, uns a, uns v) static inline struct oattr * obj_add_attr_internal(struct odes *o, struct oattr *b) { - struct oattr *a; + struct oattr *a, **z; if (!(a = o->cached_attr) || a->attr != b->attr) { - if (!(a = obj_find_attr(o, b->attr))) + z = &o->attrs; + while ((a = *z) && a->attr != b->attr) + z = &a->next; + if (!a) { - b->next = o->attrs; - o->attrs = b; + *z = b; + /* b->next is NULL */ goto done; } } -- 2.39.2