list: fix list_replace() for empty lists
authorRob Clark <robdclark@gmail.com>
Sat, 2 Jul 2016 12:02:51 +0000 (08:02 -0400)
committerRob Clark <robdclark@gmail.com>
Wed, 6 Jul 2016 14:17:30 +0000 (10:17 -0400)
commit23dd9eaa94e97450582059763fcb479e1e8fe818
treeea64a9b14fa27c198faebb541b698d5f6dcb669b
parent09fe35b450ed15b3cfc956304e96723b4c600ad8
list: fix list_replace() for empty lists

Before, it would happily copy list_head next/prev (ie. pointer to the
*from* list_head), leaving things in a confused state and causing much
mayhem.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/util/list.h