Patch 8.2.0539

10 views
Skip to first unread message

Bram Moolenaar

unread,
Apr 9, 2020, 3:33:57 PM4/9/20
to vim...@googlegroups.com

Patch 8.2.0539
Problem: Comparing two NULL list fails.
Solution: Change the order of comparing two lists.
Files: src/list.c, src/testdir/test_assert.vim


*** ../vim-8.2.0538/src/list.c 2020-04-06 22:12:57.141652839 +0200
--- src/list.c 2020-04-09 21:27:50.495754510 +0200
***************
*** 368,379 ****
{
listitem_T *item1, *item2;

- if (l1 == NULL || l2 == NULL)
- return FALSE;
if (l1 == l2)
return TRUE;
if (list_len(l1) != list_len(l2))
return FALSE;

range_list_materialize(l1);
range_list_materialize(l2);
--- 368,382 ----
{
listitem_T *item1, *item2;

if (l1 == l2)
return TRUE;
if (list_len(l1) != list_len(l2))
return FALSE;
+ if (list_len(l1) == 0)
+ // empty and NULL list are considered equal
+ return TRUE;
+ if (l1 == NULL || l2 == NULL)
+ return FALSE;

range_list_materialize(l1);
range_list_materialize(l2);
*** ../vim-8.2.0538/src/testdir/test_assert.vim 2019-09-08 18:25:36.000000000 +0200
--- src/testdir/test_assert.vim 2020-04-09 21:24:49.015882214 +0200
***************
*** 36,41 ****
--- 36,44 ----
call assert_equal(0, assert_equal(4, n))
let l = [1, 2, 3]
call assert_equal(0, assert_equal([1, 2, 3], l))
+ call assert_equal(test_null_list(), test_null_list())
+ call assert_equal(test_null_list(), [])
+ call assert_equal([], test_null_list())

let s = 'foo'
call assert_equal(1, assert_equal('bar', s))
*** ../vim-8.2.0538/src/version.c 2020-04-09 21:08:06.298505479 +0200
--- src/version.c 2020-04-09 21:33:01.798753128 +0200
***************
*** 740,741 ****
--- 740,743 ----
{ /* Add new patch number below this line */
+ /**/
+ 539,
/**/

--
BEDEVERE: Stand by for attack!!
[CUT TO enormous army forming up. Trebuchets, rows of PIKEMEN, siege
towers, pennants flying, shouts of "Stand by for attack!" Traditional
army build-up shots. The shouts echo across the ranks of the army.
We see various groups reacting, and stirring themselves in readiness.]
ARTHUR: Who are they?
BEDEVERE: Oh, just some friends!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages