From c685a4eb0713d42e535a21e602d1bd63db095307 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 27 Dec 2013 15:48:09 +0000 Subject: Enable the framework code to allow more than one mlink per mpage. Not used yet. --- mandocdb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mandocdb.c') diff --git a/mandocdb.c b/mandocdb.c index 959dbfce..1e749efa 100644 --- a/mandocdb.c +++ b/mandocdb.c @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.84 2013/12/27 15:39:03 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.85 2013/12/27 15:48:09 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013 Ingo Schwarze @@ -111,6 +111,7 @@ struct mlink { char *arch; /* architecture from directory */ char *name; /* name from file name (not empty) */ char *fsec; /* section from file name suffix */ + struct mlink *next; /* singly linked list */ }; struct title { @@ -826,7 +827,7 @@ mlink_add(struct mlink *mlink, const struct stat *st) mpage->inodev.st_dev = inodev.st_dev; ohash_insert(&mpages, slot, mpage); } else - abort(); + mlink->next = mpage->mlinks; mpage->mlinks = mlink; } @@ -851,7 +852,7 @@ mpages_free(void) mpage = ohash_first(&mpages, &slot); while (NULL != mpage) { while (NULL != (mlink = mpage->mlinks)) { - mpage->mlinks = NULL; + mpage->mlinks = mlink->next; mlink_free(mlink); } free(mpage->sec); -- cgit v1.2.3-56-ge451