summaryrefslogtreecommitdiff
path: root/src/list.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/list.c')
-rw-r--r--src/list.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/list.c b/src/list.c
index 3a6ea9766..578d6f115 100644
--- a/src/list.c
+++ b/src/list.c
@@ -1216,11 +1216,10 @@ list_copy(list_T *orig, int deep, int top, int copyID)
copy = list_alloc();
if (copy != NULL)
{
- if (orig->lv_type == NULL)
+ if (orig->lv_type == NULL || top || deep)
copy->lv_type = NULL;
else
- copy->lv_type = alloc_type(top || deep
- ? &t_list_any: orig->lv_type);
+ copy->lv_type = alloc_type(orig->lv_type);
if (copyID != 0)
{
// Do this before adding the items, because one of the items may