summaryrefslogtreecommitdiff
path: root/src/typval.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2021-09-14 17:54:30 +0200
committerBram Moolenaar <Bram@vim.org>2021-09-14 17:54:30 +0200
commit5dfe467432638fac2e0156a2f9cd0d9eb569fb39 (patch)
treef26436377c3b39cbbd4881d7c18450e61dc0d3ef /src/typval.c
parentf5785cf0592626ec17676e814d3ba58f5123bcda (diff)
downloadvim-git-5dfe467432638fac2e0156a2f9cd0d9eb569fb39.tar.gz
patch 8.2.3438: cannot manipulate blobsv8.2.3438
Problem: Cannot manipulate blobs. Solution: Add blob2list() and list2blob(). (Yegappan Lakshmanan, closes #8868)
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 3a0e2e5d9..c859122ee 100644
--- a/src/typval.c
+++ b/src/typval.c
@@ -471,6 +471,23 @@ check_for_opt_bool_arg(typval_T *args, int idx)
}
/*
+ * Give an error and return FAIL unless "args[idx]" is a blob.
+ */
+ int
+check_for_blob_arg(typval_T *args, int idx)
+{
+ if (args[idx].v_type != VAR_BLOB)
+ {
+ if (idx >= 0)
+ semsg(_(e_blob_required_for_argument_nr), idx + 1);
+ else
+ emsg(_(e_blob_required));
+ return FAIL;
+ }
+ return OK;
+}
+
+/*
* Give an error and return FAIL unless "args[idx]" is a list.
*/
int