forked from aniani/vim
patch 8.2.2255: Tcl test fails
Problem: Tcl test fails. Solution: Change option handling.
This commit is contained in:
15
src/if_tcl.c
15
src/if_tcl.c
@@ -1281,7 +1281,7 @@ tclsetoption(
|
|||||||
{
|
{
|
||||||
int err, nobjs, idx;
|
int err, nobjs, idx;
|
||||||
char_u *option;
|
char_u *option;
|
||||||
int isnum;
|
getoption_T gov;
|
||||||
long lval;
|
long lval;
|
||||||
char_u *sval;
|
char_u *sval;
|
||||||
Tcl_Obj *resobj;
|
Tcl_Obj *resobj;
|
||||||
@@ -1298,15 +1298,16 @@ tclsetoption(
|
|||||||
|
|
||||||
option = (char_u *)Tcl_GetStringFromObj(objv[objn], NULL);
|
option = (char_u *)Tcl_GetStringFromObj(objv[objn], NULL);
|
||||||
++objn;
|
++objn;
|
||||||
isnum = get_option_value(option, &lval, &sval, 0);
|
gov = get_option_value(option, &lval, &sval, 0);
|
||||||
err = TCL_OK;
|
err = TCL_OK;
|
||||||
switch (isnum)
|
switch (gov)
|
||||||
{
|
{
|
||||||
case 0:
|
case gov_string:
|
||||||
Tcl_SetResult(interp, (char *)sval, TCL_VOLATILE);
|
Tcl_SetResult(interp, (char *)sval, TCL_VOLATILE);
|
||||||
vim_free(sval);
|
vim_free(sval);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case gov_bool:
|
||||||
|
case gov_number:
|
||||||
resobj = Tcl_NewLongObj(lval);
|
resobj = Tcl_NewLongObj(lval);
|
||||||
Tcl_SetObjResult(interp, resobj);
|
Tcl_SetObjResult(interp, resobj);
|
||||||
break;
|
break;
|
||||||
@@ -1316,7 +1317,7 @@ tclsetoption(
|
|||||||
}
|
}
|
||||||
if (nobjs == 2)
|
if (nobjs == 2)
|
||||||
{
|
{
|
||||||
if (isnum)
|
if (gov != gov_string)
|
||||||
{
|
{
|
||||||
sval = NULL; // avoid compiler warning
|
sval = NULL; // avoid compiler warning
|
||||||
err = Tcl_GetIndexFromObj(interp, objv[objn], optkw, "", 0, &idx);
|
err = Tcl_GetIndexFromObj(interp, objv[objn], optkw, "", 0, &idx);
|
||||||
@@ -1326,6 +1327,7 @@ tclsetoption(
|
|||||||
err = Tcl_GetLongFromObj(interp, objv[objn], &lval);
|
err = Tcl_GetLongFromObj(interp, objv[objn], &lval);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
switch (idx)
|
switch (idx)
|
||||||
{
|
{
|
||||||
case OPT_ON:
|
case OPT_ON:
|
||||||
@@ -1339,6 +1341,7 @@ tclsetoption(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
sval = (char_u *)Tcl_GetStringFromObj(objv[objn], NULL);
|
sval = (char_u *)Tcl_GetStringFromObj(objv[objn], NULL);
|
||||||
if (err == TCL_OK)
|
if (err == TCL_OK)
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2255,
|
||||||
/**/
|
/**/
|
||||||
2254,
|
2254,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user