patch 8.2.0539: comparing two NULL list fails
Problem: Comparing two NULL list fails.
Solution: Change the order of comparing two lists.
diff --git a/src/list.c b/src/list.c
index 9fe5384..451e585 100644
--- a/src/list.c
+++ b/src/list.c
@@ -368,12 +368,15 @@
{
listitem_T *item1, *item2;
- if (l1 == NULL || l2 == NULL)
- return FALSE;
if (l1 == l2)
return TRUE;
if (list_len(l1) != list_len(l2))
return FALSE;
+ if (list_len(l1) == 0)
+ // empty and NULL list are considered equal
+ return TRUE;
+ if (l1 == NULL || l2 == NULL)
+ return FALSE;
range_list_materialize(l1);
range_list_materialize(l2);