@@ -301,6 +301,27 @@ arg_list_or_blob(type_T *type, argcontext_T *context)
301
301
return FAIL ;
302
302
}
303
303
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
+
304
325
/*
305
326
* Check "type" is a list or a dict.
306
327
*/
@@ -385,6 +406,7 @@ argcheck_T arg1_string[] = {arg_string};
385
406
argcheck_T arg3_string_nr_bool [] = {arg_string , arg_number , arg_bool };
386
407
argcheck_T arg1_float_or_nr [] = {arg_float_or_nr };
387
408
argcheck_T arg2_listblob_item [] = {arg_list_or_blob , arg_item_of_prev };
409
+ argcheck_T arg2_execute [] = {arg_string_or_list , arg_string };
388
410
argcheck_T arg23_extend [] = {arg_list_or_dict , arg_same_as_prev , arg_extend3 };
389
411
argcheck_T arg23_extendnew [] = {arg_list_or_dict , arg_same_struct_as_prev , arg_extend3 };
390
412
argcheck_T arg3_insert [] = {arg_list_or_blob , arg_item_of_prev , arg_number };
@@ -870,7 +892,7 @@ static funcentry_T global_functions[] =
870
892
ret_number_bool , f_eventhandler },
871
893
{"executable" , 1 , 1 , FEARG_1 , NULL ,
872
894
ret_number , f_executable },
873
- {"execute" , 1 , 2 , FEARG_1 , NULL ,
895
+ {"execute" , 1 , 2 , FEARG_1 , arg2_execute ,
874
896
ret_string , f_execute },
875
897
{"exepath" , 1 , 1 , FEARG_1 , NULL ,
876
898
ret_string , f_exepath },
0 commit comments