Patch 7.4.1979 (after 7.4.1976)
Problem:    Getting value of binary option is wrong. (Kent Sibilev)
Solution:   Fix type cast.  Add a test.
Files:      src/option.c, src/testdir/test_expr.vim


*** ../vim-7.4.1978/src/option.c        2016-07-01 18:16:47.497936191 +0200
--- src/option.c        2016-07-01 22:59:50.796750810 +0200
***************
*** 9102,9108 ****
        if ((int *)varp == &curbuf->b_changed)
            *numval = curbufIsChanged();
        else
!           *numval = (long) *(varnumber_T *)varp;
      }
      return 1;
  }
--- 9102,9108 ----
        if ((int *)varp == &curbuf->b_changed)
            *numval = curbufIsChanged();
        else
!           *numval = (long) *(int *)varp;
      }
      return 1;
  }
*** ../vim-7.4.1978/src/testdir/test_expr.vim   2016-07-01 11:59:43.177876159 
+0200
--- src/testdir/test_expr.vim   2016-07-01 23:08:37.852982718 +0200
***************
*** 106,108 ****
--- 106,131 ----
    " The failure is only visible using valgrind.
    call assert_fails('echo "\<C-">')
  endfunc
+ 
+ func Test_option_value()
+   " boolean
+   set bri
+   call assert_equal(1, &bri)
+   set nobri
+   call assert_equal(0, &bri)
+ 
+   " number
+   set ts=1
+   call assert_equal(1, &ts)
+   set ts=8
+   call assert_equal(8, &ts)
+ 
+   " string
+   exe "set cedit=\<Esc>"
+   call assert_equal("\<Esc>", &cedit)
+   set cpo=
+   call assert_equal("", &cpo)
+   set cpo=abcdefgi
+   call assert_equal("abcdefgi", &cpo)
+   set cpo&vim
+ endfunc
*** ../vim-7.4.1978/src/version.c       2016-07-01 21:48:59.723149241 +0200
--- src/version.c       2016-07-01 23:03:42.081341449 +0200
***************
*** 760,761 ****
--- 760,763 ----
  {   /* Add new patch number below this line */
+ /**/
+     1979,
  /**/

-- 
If Microsoft would build a car...
... The airbag system would ask "are you SURE?" before deploying.

 /// 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].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui