0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.3438: cannot manipulate blobs

Problem:    Cannot manipulate blobs.
Solution:   Add blob2list() and list2blob(). (Yegappan Lakshmanan,
            closes #8868)
This commit is contained in:
Yegappan Lakshmanan
2021-09-14 17:54:30 +02:00
committed by Bram Moolenaar
parent f5785cf059
commit 5dfe467432
11 changed files with 185 additions and 1 deletions

View File

@@ -470,6 +470,23 @@ check_for_opt_bool_arg(typval_T *args, int idx)
return check_for_bool_arg(args, 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.
*/