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:
committed by
Christian Brabandt
parent
6b56711804
commit
da34f84847
17
src/dict.c
17
src/dict.c
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user