diff options
Diffstat (limited to 'usr.bin/make/lst.lib/lstConcat.c')
-rw-r--r-- | usr.bin/make/lst.lib/lstConcat.c | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/usr.bin/make/lst.lib/lstConcat.c b/usr.bin/make/lst.lib/lstConcat.c index f0c771c..5391796 100644 --- a/usr.bin/make/lst.lib/lstConcat.c +++ b/usr.bin/make/lst.lib/lstConcat.c @@ -87,12 +87,11 @@ Lst_Concat(Lst list1, Lst list2, int flags) if (flags == LST_CONCLINK) { if (list2->firstPtr != NULL) { /* - * We set the nextPtr of the - * last element of list two to be NULL to make the loop easier and - * so we don't need an extra case should the first list turn - * out to be non-circular -- the final element will already point - * to NULL space and the first element will be untouched if it - * existed before and will also point to NULL space if it didn't. + * We set the nextPtr of the last element of list two to be NULL + * to make the loop easier and so we don't need an extra case -- + * the final element will already point to NULL space and the first + * element will be untouched if it existed before and will also + * point to NULL space if it didn't. */ list2->lastPtr->nextPtr = NULL; /* @@ -111,15 +110,6 @@ Lst_Concat(Lst list1, Lst list2, int flags) } list1->lastPtr = list2->lastPtr; } - if (list1->isCirc && list1->firstPtr != NULL) { - /* - * If the first list is supposed to be circular and it is (now) - * non-empty, we must make sure it's circular by linking the - * first element to the last and vice versa - */ - list1->firstPtr->prevPtr = list1->lastPtr; - list1->lastPtr->nextPtr = list1->firstPtr; - } free(list2); } else if (list2->firstPtr != NULL) { /* @@ -156,23 +146,7 @@ Lst_Concat(Lst list1, Lst list2, int flags) * of list one. */ list1->lastPtr = last; - - /* - * The circularity of both list one and list two must be corrected - * for -- list one because of the new nodes added to it; list two - * because of the alteration of list2->lastPtr's nextPtr to ease the - * above for loop. - */ - if (list1->isCirc) { - list1->lastPtr->nextPtr = list1->firstPtr; - list1->firstPtr->prevPtr = list1->lastPtr; - } else { - last->nextPtr = NULL; - } - - if (list2->isCirc) { - list2->lastPtr->nextPtr = list2->firstPtr; - } + last->nextPtr = NULL; } return (SUCCESS); |