Fix list slice
This commit is contained in:
parent
df7307739e
commit
333e9fd675
@ -169,17 +169,14 @@ size_t list_slice(list_t* x, list_t* s, ssize_t i, size_t n, _Bool cut) {
|
||||
} else {
|
||||
if (c->prev) {
|
||||
c->prev->next = e->next;
|
||||
} else x->first = e->next;
|
||||
} else s->first = e->next;
|
||||
|
||||
if (e->next) {
|
||||
e->next->prev = c->prev;
|
||||
} else s->last = c->prev;
|
||||
|
||||
e->next = nullptr;
|
||||
c->prev = nullptr;
|
||||
|
||||
x->first = c;
|
||||
x->last = e;
|
||||
(x->first = c)->prev = nullptr;
|
||||
(x->last = e)->next = nullptr;
|
||||
}
|
||||
|
||||
return r;
|
||||
|
Loading…
Reference in New Issue
Block a user