Mercurial > vim
comparison src/typval.c @ 30188:ba22d5536d3e v9.0.0430
patch 9.0.0430: cannot use repeat() with a blob
Commit: https://github.com/vim/vim/commit/375141e1f80dced9be738568a3418f65813f4a2f
Author: Bakudankun <bakudankun@gmail.com>
Date: Fri Sep 9 18:46:47 2022 +0100
patch 9.0.0430: cannot use repeat() with a blob
Problem: Cannot use repeat() with a blob.
Solution: Implement blob repeat. (closes https://github.com/vim/vim/issues/11090)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 09 Sep 2022 20:00:05 +0200 |
parents | adb0de8be4ce |
children | 642b5e748028 |
comparison
equal
deleted
inserted
replaced
30187:21e6b6407754 | 30188:ba22d5536d3e |
---|---|
787 int | 787 int |
788 check_for_opt_string_or_number_or_list_arg(typval_T *args, int idx) | 788 check_for_opt_string_or_number_or_list_arg(typval_T *args, int idx) |
789 { | 789 { |
790 return (args[idx].v_type == VAR_UNKNOWN | 790 return (args[idx].v_type == VAR_UNKNOWN |
791 || check_for_string_or_number_or_list_arg(args, idx) != FAIL); | 791 || check_for_string_or_number_or_list_arg(args, idx) != FAIL); |
792 } | |
793 | |
794 /* | |
795 * Give an error and return FAIL unless "args[idx]" is a string or a number | |
796 * or a list or a blob. | |
797 */ | |
798 int | |
799 check_for_string_or_number_or_list_or_blob_arg(typval_T *args, int idx) | |
800 { | |
801 if (args[idx].v_type != VAR_STRING | |
802 && args[idx].v_type != VAR_NUMBER | |
803 && args[idx].v_type != VAR_LIST | |
804 && args[idx].v_type != VAR_BLOB) | |
805 { | |
806 semsg(_(e_string_number_list_or_blob_required_for_argument_nr), idx + 1); | |
807 return FAIL; | |
808 } | |
809 return OK; | |
792 } | 810 } |
793 | 811 |
794 /* | 812 /* |
795 * Give an error and return FAIL unless "args[idx]" is a string or a list | 813 * Give an error and return FAIL unless "args[idx]" is a string or a list |
796 * or a dict. | 814 * or a dict. |