Patch 8.2.3257

3 views
Skip to first unread message

Bram Moolenaar

unread,
Jul 31, 2021, 12:34:35 PM7/31/21
to vim...@googlegroups.com

Patch 8.2.3257
Problem: Calling prop_find() with -1 for ID gives errornous error. (Naohiro
Ono)
Solution: When passing -1 use -2. (closes #8674)
Files: src/textprop.c, src/testdir/test_textprop.vim


*** ../vim-8.2.3256/src/textprop.c 2021-07-28 13:30:12.212929910 +0200
--- src/textprop.c 2021-07-31 18:32:31.413153828 +0200
***************
*** 686,692 ****
--- 686,696 ----
skipstart = dict_get_bool(dict, (char_u *)"skipstart", 0);

if (dict_find(dict, (char_u *)"id", -1) != NULL)
+ {
id = dict_get_number(dict, (char_u *)"id");
+ if (id == -1)
+ id = -2;
+ }
if (dict_find(dict, (char_u *)"type", -1))
{
char_u *name = dict_get_string(dict, (char_u *)"type", FALSE);
*** ../vim-8.2.3256/src/testdir/test_textprop.vim 2021-07-28 13:30:12.212929910 +0200
--- src/testdir/test_textprop.vim 2021-07-31 18:32:01.801327438 +0200
***************
*** 239,244 ****
--- 239,247 ----
let result = prop_find({'type': 'prop_name', 'lnum': 1}, 'f')
call assert_equal(expected[0], result)

+ " When ID is -1 it's like prop is not found.
+ call assert_equal({}, prop_find({'id': -1}))
+
call prop_clear(1,6)
call prop_type_delete('prop_name')

*** ../vim-8.2.3256/src/version.c 2021-07-31 17:20:00.620832958 +0200
--- src/version.c 2021-07-31 18:33:03.612970402 +0200
***************
*** 757,758 ****
--- 757,760 ----
{ /* Add new patch number below this line */
+ /**/
+ 3257,
/**/

--
GALAHAD turns back. We see from his POV the lovely ZOOT standing by him
smiling enchantingly and a number of equally delectable GIRLIES draped
around in the seductively poulticed room. They look at him smilingly and
wave.
"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/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages