summaryrefslogtreecommitdiff
path: root/src/typval.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2021-07-28 11:51:48 +0200
committerBram Moolenaar <Bram@vim.org>2021-07-28 11:51:48 +0200
commit7e6a2a64f09df577f29e024c1d1e6733d6bc1b7c (patch)
tree2c8867bbd35e1c07756c74041e2fff09e7f9f928 /src/typval.c
parent9088784972c0ed72997de8752964d6b587218778 (diff)
downloadvim-git-7e6a2a64f09df577f29e024c1d1e6733d6bc1b7c.tar.gz
patch 8.2.3232: system() does not work without a second argumentv8.2.3232
Problem: system() does not work without a second argument. Solution: Do not require a second argument. (Yegappan Lakshmanan, closes #8651, closes #8650)
Diffstat (limited to 'src/typval.c')
-rw-r--r--src/typval.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/typval.c b/src/typval.c
index 34032177d..fb527e988 100644
--- a/src/typval.c
+++ b/src/typval.c
@@ -727,6 +727,17 @@ check_for_string_or_number_or_list_arg(typval_T *args, int idx)
}
/*
+ * Give an error and return FAIL unless "args[idx]" is an optional string
+ * or number or a list
+ */
+ int
+check_for_opt_string_or_number_or_list_arg(typval_T *args, int idx)
+{
+ return (args[idx].v_type == VAR_UNKNOWN
+ || 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 list
* or a dict.
*/