Karsten Hopp 22ccd5
To: vim_dev@googlegroups.com
Karsten Hopp 22ccd5
Subject: Patch 7.3.954
Karsten Hopp 22ccd5
Fcc: outbox
Karsten Hopp 22ccd5
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 22ccd5
Mime-Version: 1.0
Karsten Hopp 22ccd5
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 22ccd5
Content-Transfer-Encoding: 8bit
Karsten Hopp 22ccd5
------------
Karsten Hopp 22ccd5
Karsten Hopp 22ccd5
Patch 7.3.954
Karsten Hopp 22ccd5
Problem:    No check if PyObject_IsTrue fails.
Karsten Hopp 22ccd5
Solution:   Add a check for -1 value. (ZyX)
Karsten Hopp 22ccd5
Files:	    src/if_py_both.h
Karsten Hopp 22ccd5
Karsten Hopp 22ccd5
Karsten Hopp 22ccd5
*** ../vim-7.3.953/src/if_py_both.h	2013-05-15 15:51:03.000000000 +0200
Karsten Hopp 22ccd5
--- src/if_py_both.h	2013-05-15 16:08:53.000000000 +0200
Karsten Hopp 22ccd5
***************
Karsten Hopp 22ccd5
*** 700,706 ****
Karsten Hopp 22ccd5
  	}
Karsten Hopp 22ccd5
  	else
Karsten Hopp 22ccd5
  	{
Karsten Hopp 22ccd5
! 	    if (PyObject_IsTrue(val))
Karsten Hopp 22ccd5
  		this->dict->dv_lock = VAR_LOCKED;
Karsten Hopp 22ccd5
  	    else
Karsten Hopp 22ccd5
  		this->dict->dv_lock = 0;
Karsten Hopp 22ccd5
--- 700,709 ----
Karsten Hopp 22ccd5
  	}
Karsten Hopp 22ccd5
  	else
Karsten Hopp 22ccd5
  	{
Karsten Hopp 22ccd5
! 	    int		istrue = PyObject_IsTrue(val);
Karsten Hopp 22ccd5
! 	    if (istrue == -1)
Karsten Hopp 22ccd5
! 		return -1;
Karsten Hopp 22ccd5
! 	    else if (istrue)
Karsten Hopp 22ccd5
  		this->dict->dv_lock = VAR_LOCKED;
Karsten Hopp 22ccd5
  	    else
Karsten Hopp 22ccd5
  		this->dict->dv_lock = 0;
Karsten Hopp 22ccd5
***************
Karsten Hopp 22ccd5
*** 1201,1207 ****
Karsten Hopp 22ccd5
  	}
Karsten Hopp 22ccd5
  	else
Karsten Hopp 22ccd5
  	{
Karsten Hopp 22ccd5
! 	    if (PyObject_IsTrue(val))
Karsten Hopp 22ccd5
  		this->list->lv_lock = VAR_LOCKED;
Karsten Hopp 22ccd5
  	    else
Karsten Hopp 22ccd5
  		this->list->lv_lock = 0;
Karsten Hopp 22ccd5
--- 1204,1213 ----
Karsten Hopp 22ccd5
  	}
Karsten Hopp 22ccd5
  	else
Karsten Hopp 22ccd5
  	{
Karsten Hopp 22ccd5
! 	    int		istrue = PyObject_IsTrue(val);
Karsten Hopp 22ccd5
! 	    if (istrue == -1)
Karsten Hopp 22ccd5
! 		return -1;
Karsten Hopp 22ccd5
! 	    else if (istrue)
Karsten Hopp 22ccd5
  		this->list->lv_lock = VAR_LOCKED;
Karsten Hopp 22ccd5
  	    else
Karsten Hopp 22ccd5
  		this->list->lv_lock = 0;
Karsten Hopp 22ccd5
***************
Karsten Hopp 22ccd5
*** 1479,1485 ****
Karsten Hopp 22ccd5
  
Karsten Hopp 22ccd5
      if (flags & SOPT_BOOL)
Karsten Hopp 22ccd5
      {
Karsten Hopp 22ccd5
! 	r = set_option_value_for(key, PyObject_IsTrue(valObject), NULL,
Karsten Hopp 22ccd5
  				opt_flags, this->opt_type, this->from);
Karsten Hopp 22ccd5
      }
Karsten Hopp 22ccd5
      else if (flags & SOPT_NUM)
Karsten Hopp 22ccd5
--- 1485,1494 ----
Karsten Hopp 22ccd5
  
Karsten Hopp 22ccd5
      if (flags & SOPT_BOOL)
Karsten Hopp 22ccd5
      {
Karsten Hopp 22ccd5
! 	int	istrue = PyObject_IsTrue(valObject);
Karsten Hopp 22ccd5
! 	if (istrue == -1)
Karsten Hopp 22ccd5
! 	    return -1;
Karsten Hopp 22ccd5
! 	r = set_option_value_for(key, istrue, NULL,
Karsten Hopp 22ccd5
  				opt_flags, this->opt_type, this->from);
Karsten Hopp 22ccd5
      }
Karsten Hopp 22ccd5
      else if (flags & SOPT_NUM)
Karsten Hopp 22ccd5
*** ../vim-7.3.953/src/version.c	2013-05-15 16:04:34.000000000 +0200
Karsten Hopp 22ccd5
--- src/version.c	2013-05-15 16:08:26.000000000 +0200
Karsten Hopp 22ccd5
***************
Karsten Hopp 22ccd5
*** 730,731 ****
Karsten Hopp 22ccd5
--- 730,733 ----
Karsten Hopp 22ccd5
  {   /* Add new patch number below this line */
Karsten Hopp 22ccd5
+ /**/
Karsten Hopp 22ccd5
+     954,
Karsten Hopp 22ccd5
  /**/
Karsten Hopp 22ccd5
Karsten Hopp 22ccd5
-- 
Karsten Hopp 22ccd5
The early bird gets the worm. The second mouse gets the cheese.
Karsten Hopp 22ccd5
Karsten Hopp 22ccd5
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 22ccd5
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 22ccd5
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 22ccd5
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///