patch 9.1.1668: items() does not work for Blobs

Problem:  items() does not work for Blobs
Solution: Extend items() to support Blob
          (Yegappan Lakshmanan).

closes: #18080

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Yegappan Lakshmanan
2025-08-23 06:18:34 -04:00
committed by Christian Brabandt
parent 6b56711804
commit da34f84847
13 changed files with 94 additions and 26 deletions

View File

@ -1557,9 +1557,7 @@ dict2list(typval_T *argvars, typval_T *rettv, dict2list_T what)
if (rettv_list_alloc(rettv) == FAIL)
return;
if ((what == DICT2LIST_ITEMS
? check_for_string_list_tuple_or_dict_arg(argvars, 0)
: check_for_dict_arg(argvars, 0)) == FAIL)
if (check_for_dict_arg(argvars, 0) == FAIL)
return;
d = argvars[0].vval.v_dict;
@ -1612,19 +1610,12 @@ dict2list(typval_T *argvars, typval_T *rettv, dict2list_T what)
}
/*
* "items(dict)" function
* "items()" function
*/
void
f_items(typval_T *argvars, typval_T *rettv)
dict2items(typval_T *argvars, typval_T *rettv)
{
if (argvars[0].v_type == VAR_STRING)
string2items(argvars, rettv);
else if (argvars[0].v_type == VAR_LIST)
list2items(argvars, rettv);
else if (argvars[0].v_type == VAR_TUPLE)
tuple2items(argvars, rettv);
else
dict2list(argvars, rettv, DICT2LIST_ITEMS);
dict2list(argvars, rettv, DICT2LIST_ITEMS);
}
/*