diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2021-09-14 17:54:30 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-09-14 17:54:30 +0200 |
commit | 5dfe467432638fac2e0156a2f9cd0d9eb569fb39 (patch) | |
tree | f26436377c3b39cbbd4881d7c18450e61dc0d3ef /src/typval.c | |
parent | f5785cf0592626ec17676e814d3ba58f5123bcda (diff) | |
download | vim-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.c | 17 |
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 |