mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-20 02:42:09 +03:00
_libssh2_list_insert() fixed to work
While this is code not currently in use, it is part of the generic linked list code and since I found the error I thought I'd better fix it since we might bring in this function into the code one day.
This commit is contained in:
@@ -443,6 +443,10 @@ void _libssh2_list_insert(struct list_node *after, /* insert before this */
|
|||||||
and must be made to point to 'entry' correctly */
|
and must be made to point to 'entry' correctly */
|
||||||
if(entry->prev)
|
if(entry->prev)
|
||||||
entry->prev->next = entry;
|
entry->prev->next = entry;
|
||||||
|
else
|
||||||
|
/* there was no node before this, so we make sure we point the head
|
||||||
|
pointer to this node */
|
||||||
|
after->head->first = entry;
|
||||||
|
|
||||||
/* after's prev entry points back to entry */
|
/* after's prev entry points back to entry */
|
||||||
after->prev = entry;
|
after->prev = entry;
|
||||||
|
|||||||
Reference in New Issue
Block a user