diff src/typval.c @ 25390:a6c347a0c6e3 v8.2.3232

patch 8.2.3232: system() does not work without a second argument Commit: https://github.com/vim/vim/commit/7e6a2a64f09df577f29e024c1d1e6733d6bc1b7c Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Wed Jul 28 11:51:48 2021 +0200 patch 8.2.3232: system() does not work without a second argument Problem: system() does not work without a second argument. Solution: Do not require a second argument. (Yegappan Lakshmanan, closes #8651, closes #8650)
author Bram Moolenaar <Bram@vim.org>
date Wed, 28 Jul 2021 12:00:06 +0200
parents e8e2c4d33b9b
children 9ed6587bcc0f
line wrap: on
line diff
--- a/src/typval.c
+++ b/src/typval.c
@@ -727,6 +727,17 @@ check_for_string_or_number_or_list_arg(t
 }
 
 /*
+ * 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.
  */