From: Martin Mares Date: Thu, 5 Aug 2004 12:13:41 +0000 (+0000) Subject: New attributes are now added at the end of the list. X-Git-Tag: holmes-import~930 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=27a399729245ab082e8f76985d4cccb363ad82bb;p=libucw.git New attributes are now added at the end of the list. --- 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; } }