diff options
Diffstat (limited to 'usr.bin/make/lst.lib/lstInsert.c')
-rw-r--r-- | usr.bin/make/lst.lib/lstInsert.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/usr.bin/make/lst.lib/lstInsert.c b/usr.bin/make/lst.lib/lstInsert.c index 724924adf071..07070202e470 100644 --- a/usr.bin/make/lst.lib/lstInsert.c +++ b/usr.bin/make/lst.lib/lstInsert.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstInsert.c,v 1.4 1995/06/14 15:21:21 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstInsert.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstInsert.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstInsert.c,v 1.4 1995/06/14 15:21:21 christos Exp $"; +#endif #endif /* not lint */ /*- @@ -76,17 +82,17 @@ Lst_Insert (l, ln, d) */ if (LstValid (l) && (LstIsEmpty (l) && ln == NILLNODE)) goto ok; - + if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) { return (FAILURE); } - + ok: PAlloc (nLNode, ListNode); - + nLNode->datum = d; nLNode->useCount = nLNode->flags = 0; - + if (ln == NILLNODE) { if (list->isCirc) { nLNode->prevPtr = nLNode->nextPtr = nLNode; @@ -97,17 +103,17 @@ Lst_Insert (l, ln, d) } else { nLNode->prevPtr = lNode->prevPtr; nLNode->nextPtr = lNode; - + if (nLNode->prevPtr != NilListNode) { nLNode->prevPtr->nextPtr = nLNode; } lNode->prevPtr = nLNode; - + if (lNode == list->firstPtr) { list->firstPtr = nLNode; } } - + return (SUCCESS); } - + |