@@ -301,6 +301,27 @@ arg_list_or_blob(type_T *type, argcontext_T *context)
301301 return FAIL ;
302302}
303303
304+ /*
305+ * Check "type" is a string or a list of strings.
306+ */
307+ static int
308+ arg_string_or_list (type_T * type , argcontext_T * context )
309+ {
310+ if (type -> tt_type == VAR_ANY || type -> tt_type == VAR_STRING )
311+ return OK ;
312+ if (type -> tt_type != VAR_LIST )
313+ {
314+ arg_type_mismatch (& t_string , type , context -> arg_idx + 1 );
315+ return FAIL ;
316+ }
317+ if (type -> tt_member -> tt_type == VAR_ANY
318+ || type -> tt_member -> tt_type == VAR_STRING )
319+ return OK ;
320+
321+ arg_type_mismatch (& t_list_string , type , context -> arg_idx + 1 );
322+ return FAIL ;
323+ }
324+
304325/*
305326 * Check "type" is a list or a dict.
306327 */
@@ -385,6 +406,7 @@ argcheck_T arg1_string[] = {arg_string};
385406argcheck_T arg3_string_nr_bool [] = {arg_string , arg_number , arg_bool };
386407argcheck_T arg1_float_or_nr [] = {arg_float_or_nr };
387408argcheck_T arg2_listblob_item [] = {arg_list_or_blob , arg_item_of_prev };
409+ argcheck_T arg2_execute [] = {arg_string_or_list , arg_string };
388410argcheck_T arg23_extend [] = {arg_list_or_dict , arg_same_as_prev , arg_extend3 };
389411argcheck_T arg23_extendnew [] = {arg_list_or_dict , arg_same_struct_as_prev , arg_extend3 };
390412argcheck_T arg3_insert [] = {arg_list_or_blob , arg_item_of_prev , arg_number };
@@ -870,7 +892,7 @@ static funcentry_T global_functions[] =
870892 ret_number_bool , f_eventhandler },
871893 {"executable" , 1 , 1 , FEARG_1 , NULL ,
872894 ret_number , f_executable },
873- {"execute" , 1 , 2 , FEARG_1 , NULL ,
895+ {"execute" , 1 , 2 , FEARG_1 , arg2_execute ,
874896 ret_string , f_execute },
875897 {"exepath" , 1 , 1 , FEARG_1 , NULL ,
876898 ret_string , f_exepath },
0 commit comments