summaryrefslogtreecommitdiff
path: root/src/typval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/typval.c')
-rw-r--r--src/typval.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/typval.c b/src/typval.c
index 101f48f34..12a741ec2 100644
--- a/src/typval.c
+++ b/src/typval.c
@@ -509,6 +509,23 @@ check_for_list_arg(typval_T *args, int idx)
}
/*
+ * Give an error and return FAIL unless "args[idx]" is a non-NULL list.
+ */
+ int
+check_for_nonnull_list_arg(typval_T *args, int idx)
+{
+ if (check_for_list_arg(args, idx) == FAIL)
+ return FAIL;
+
+ if (args[idx].vval.v_list == NULL)
+ {
+ semsg(_(e_non_null_list_required_for_argument_nr), idx + 1);
+ return FAIL;
+ }
+ return OK;
+}
+
+/*
* Check for an optional list argument at 'idx'
*/
int