On Fri, Mar 13, 2009 at 09:57:54AM +0200, Yorick Hardy wrote: > Thanks for the comments. I hope this attempt is better. [...] > @@ -947,21 +949,13 @@ > * Add a conditional appending "make" option. > */ > void > -appendcondmkoption(const char *selname, const char *name, const char *value) > +appendcondmkoption(struct nvlist *cnd, const char *name, const char *value) > { > - struct nvlist *nv, *lnv; > - const char *n; > - > - n = strtolower(selname); > - nv = newnv(name, value, NULL, 0, NULL); > - if (ht_insert(condmkopttab, n, nv) == 0) > - return; > + struct nvlist *nv; > > - if ((lnv = ht_lookup(condmkopttab, n)) == NULL) > - panic("appendcondmkoption"); > - for (; lnv->nv_next != NULL; lnv = lnv->nv_next) > - /* search for the last list element */; > - lnv->nv_next = nv; > + nv = newnv(name, value, cnd, 0, NULL); > + *nextcndmkopt = nv; > + nextcndmkopt = &nv->nv_next; We're in trouble there, because of the strtolower() and the fact that there is one thing that is actually needing that idiosyncrasie in the tree right now. Your patch is fine as far as I'm concerned, but I need to think about how to do the compatibility there. I'll commit when I'm satisfied :-) -- Quentin Garnier - cube%cubidou.net@localhost - cube%NetBSD.org@localhost "See the look on my face from staying too long in one place [...] every time the morning breaks I know I'm closer to falling" KT Tunstall, Saving My Face, Drastic Fantastic, 2007.
Attachment:
pgprSBMnh9sP8.pgp
Description: PGP signature