Patch 8.2.2783
Problem: Duplicate code for setting byte in blob, blob test may fail.
Solution: Call blob_set_append(). Test sort failure with "N".
Files: src/eval.c, src/testdir/test_blob.vim
*** ../vim-8.2.2782/src/eval.c 2021-04-14 21:30:02.927966474 +0200
--- src/eval.c 2021-04-17 20:18:18.675883827 +0200
***************
*** 1321,1341 ****
{
val = (int)tv_get_number_chk(rettv, &error);
if (!error)
! {
! garray_T *gap = &lp->ll_blob->bv_ga;
!
! // Allow for appending a byte. Setting a byte beyond
! // the end is an error otherwise.
! if (lp->ll_n1 < gap->ga_len
! || (lp->ll_n1 == gap->ga_len
! && ga_grow(&lp->ll_blob->bv_ga, 1) == OK))
! {
! blob_set(lp->ll_blob, lp->ll_n1, val);
! if (lp->ll_n1 == gap->ga_len)
! ++gap->ga_len;
! }
! // error for invalid range was already given in get_lval()
! }
}
}
else if (op != NULL && *op != '=')
--- 1321,1327 ----
{
val = (int)tv_get_number_chk(rettv, &error);
if (!error)
! blob_set_append(lp->ll_blob, lp->ll_n1, val);
}
}
else if (op != NULL && *op != '=')
*** ../vim-8.2.2782/src/testdir/test_blob.vim 2021-04-18 15:48:00.558271397
+0200
--- src/testdir/test_blob.vim 2021-04-18 16:07:44.488504715 +0200
***************
*** 630,636 ****
if has('float')
call CheckLegacyAndVim9Failure(['call sort([1.0, 0z11], "f")'], 'E975:')
endif
! call CheckLegacyAndVim9Failure(['call sort(["abc", 0z11], "f")'], 'E892:')
endfunc
" vim: shiftwidth=2 sts=2 expandtab
--- 630,636 ----
if has('float')
call CheckLegacyAndVim9Failure(['call sort([1.0, 0z11], "f")'], 'E975:')
endif
! call CheckLegacyAndVim9Failure(['call sort([11, 0z11], "N")'], 'E974:')
endfunc
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.2782/src/version.c 2021-04-18 15:48:00.558271397 +0200
--- src/version.c 2021-04-18 16:01:14.150177161 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2783,
/**/
--
hundred-and-one symptoms of being an internet addict:
119. You are reading a book and look for the scroll bar to get to
the next page.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202104181409.13IE9K2g332138%40masaka.moolenaar.net.