From 375141e1f80dced9be738568a3418f65813f4a2f Mon Sep 17 00:00:00 2001 From: Bakudankun Date: Fri, 9 Sep 2022 18:46:47 +0100 Subject: patch 9.0.0430: cannot use repeat() with a blob Problem: Cannot use repeat() with a blob. Solution: Implement blob repeat. (closes #11090) --- src/typval.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/typval.c') diff --git a/src/typval.c b/src/typval.c index 12a741ec2..95abe212e 100644 --- a/src/typval.c +++ b/src/typval.c @@ -791,6 +791,24 @@ check_for_opt_string_or_number_or_list_arg(typval_T *args, int idx) || check_for_string_or_number_or_list_arg(args, idx) != FAIL); } +/* + * Give an error and return FAIL unless "args[idx]" is a string or a number + * or a list or a blob. + */ + int +check_for_string_or_number_or_list_or_blob_arg(typval_T *args, int idx) +{ + if (args[idx].v_type != VAR_STRING + && args[idx].v_type != VAR_NUMBER + && args[idx].v_type != VAR_LIST + && args[idx].v_type != VAR_BLOB) + { + semsg(_(e_string_number_list_or_blob_required_for_argument_nr), idx + 1); + return FAIL; + } + return OK; +} + /* * Give an error and return FAIL unless "args[idx]" is a string or a list * or a dict. -- cgit v1.2.1