diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-15 11:43:42 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-07-15 15:21:39 +0800 |
commit | a649af4dbaba5ef13dcbf610fe584dbc67cf2435 (patch) | |
tree | 9798e6718ce448953e32caf604641b063f58b5fc /src/nvim/ex_docmd.c | |
parent | 7b5b7b3cc6306e9313dcf677f212cb132bd38aa0 (diff) | |
download | rneovim-a649af4dbaba5ef13dcbf610fe584dbc67cf2435.tar.gz rneovim-a649af4dbaba5ef13dcbf610fe584dbc67cf2435.tar.bz2 rneovim-a649af4dbaba5ef13dcbf610fe584dbc67cf2435.zip |
vim-patch:8.2.0426: some errors were not tested for
Problem: Some errors were not tested for.
Solution: Add tests. (Dominique Pelle, closes vim/vim#5824)
https://github.com/vim/vim/commit/9b9be007e7d674f49fc2b650f840d08532b180ad
Cherry-pick get_highest_fnum() from patch 8.1.1908 to make tests pass.
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 9e8262fdfc..4e6846bf21 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -4616,8 +4616,9 @@ char *invalid_range(exarg_T *eap) } break; case ADDR_BUFFERS: - if (eap->line1 < firstbuf->b_fnum - || eap->line2 > lastbuf->b_fnum) { + // Only a boundary check, not whether the buffers actually + // exist. + if (eap->line1 < 1 || eap->line2 > get_highest_fnum()) { return _(e_invrange); } break; |