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 -- [email protected] -- 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    ///

-- 
-- 
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/202012311711.0BVHBg8H1278356%40masaka.moolenaar.net.

Raspunde prin e-mail lui