Blob Blame History Raw
To: vim_dev@googlegroups.com
Subject: Patch 7.3.652
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.3.652
Problem:    Workaround for Python crash isn't perfect.
Solution:   Change the type of the length argument. (Sean Estabrooks)
Files:	    src/if_py_both.h


*** ../vim-7.3.651/src/if_py_both.h	2012-08-08 16:05:03.000000000 +0200
--- src/if_py_both.h	2012-09-05 17:15:31.000000000 +0200
***************
*** 74,91 ****
      static PyObject *
  OutputWrite(PyObject *self, PyObject *args)
  {
!     int len;
      char *str = NULL;
      int error = ((OutputObject *)(self))->error;
  
      if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
  	return NULL;
  
-     /* TODO: This works around a gcc optimizer problem and avoids Vim
-      * from crashing.  Should find a real solution. */
-     if (str == NULL)
- 	return NULL;
- 
      Py_BEGIN_ALLOW_THREADS
      Python_Lock_Vim();
      writer((writefn)(error ? emsg : msg), (char_u *)str, len);
--- 74,86 ----
      static PyObject *
  OutputWrite(PyObject *self, PyObject *args)
  {
!     Py_ssize_t len;
      char *str = NULL;
      int error = ((OutputObject *)(self))->error;
  
      if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
  	return NULL;
  
      Py_BEGIN_ALLOW_THREADS
      Python_Lock_Vim();
      writer((writefn)(error ? emsg : msg), (char_u *)str, len);
*** ../vim-7.3.651/src/version.c	2012-09-05 15:15:01.000000000 +0200
--- src/version.c	2012-09-05 17:27:46.000000000 +0200
***************
*** 721,722 ****
--- 721,724 ----
  {   /* Add new patch number below this line */
+ /**/
+     652,
  /**/

-- 
GUARD #2:  It could be carried by an African swallow!
GUARD #1:  Oh, yeah, an African swallow maybe, but not a European swallow,
           that's my point.
GUARD #2:  Oh, yeah, I agree with that...
                                  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- Bram@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    ///