Patch 8.2.2255

5 views
Skip to first unread message

Bram Moolenaar

unread,
Dec 31, 2020, 12:11:52 PM12/31/20
to vim...@googlegroups.com

Patch 8.2.2255 (after 8.2.2254)
Problem: Tcl test fails.
Solution: Change option handling.
Files: src/if_tcl.c


*** ../vim-8.2.2254/src/if_tcl.c 2020-06-24 20:33:59.565106319 +0200
--- src/if_tcl.c 2020-12-31 16:53:49.838870122 +0100
***************
*** 1281,1287 ****
{
int err, nobjs, idx;
char_u *option;
! int isnum;
long lval;
char_u *sval;
Tcl_Obj *resobj;
--- 1281,1287 ----
{
int err, nobjs, idx;
char_u *option;
! getoption_T gov;
long lval;
char_u *sval;
Tcl_Obj *resobj;
***************
*** 1298,1312 ****

option = (char_u *)Tcl_GetStringFromObj(objv[objn], NULL);
++objn;
! isnum = get_option_value(option, &lval, &sval, 0);
err = TCL_OK;
! switch (isnum)
{
! case 0:
Tcl_SetResult(interp, (char *)sval, TCL_VOLATILE);
vim_free(sval);
break;
! case 1:
resobj = Tcl_NewLongObj(lval);
Tcl_SetObjResult(interp, resobj);
break;
--- 1298,1313 ----

option = (char_u *)Tcl_GetStringFromObj(objv[objn], NULL);
++objn;
! gov = get_option_value(option, &lval, &sval, 0);
err = TCL_OK;
! switch (gov)
{
! case gov_string:
Tcl_SetResult(interp, (char *)sval, TCL_VOLATILE);
vim_free(sval);
break;
! case gov_bool:
! case gov_number:
resobj = Tcl_NewLongObj(lval);
Tcl_SetObjResult(interp, resobj);
break;
***************
*** 1316,1322 ****
}
if (nobjs == 2)
{
! if (isnum)
{
sval = NULL; // avoid compiler warning
err = Tcl_GetIndexFromObj(interp, objv[objn], optkw, "", 0, &idx);
--- 1317,1323 ----
}
if (nobjs == 2)
{
! if (gov != gov_string)
{
sval = NULL; // avoid compiler warning
err = Tcl_GetIndexFromObj(interp, objv[objn], optkw, "", 0, &idx);
***************
*** 1326,1342 ****
err = Tcl_GetLongFromObj(interp, objv[objn], &lval);
}
else
- switch (idx)
{
! case OPT_ON:
! lval = 1;
! break;
! case OPT_OFF:
! lval = 0;
! break;
! case OPT_TOGGLE:
! lval = !lval;
! break;
}
}
else
--- 1327,1345 ----
err = Tcl_GetLongFromObj(interp, objv[objn], &lval);
}
else
{
! switch (idx)
! {
! case OPT_ON:
! lval = 1;
! break;
! case OPT_OFF:
! lval = 0;
! break;
! case OPT_TOGGLE:
! lval = !lval;
! break;
! }
}
}
else
*** ../vim-8.2.2254/src/version.c 2020-12-31 17:40:57.536087870 +0100
--- src/version.c 2020-12-31 18:10:59.618168597 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2255,
/**/

--
I'm trying to be an optimist, but I don't think it'll work.

/// 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