Karsten Hopp fae23d
To: vim_dev@googlegroups.com
Karsten Hopp fae23d
Subject: Patch 7.3.1158
Karsten Hopp fae23d
Fcc: outbox
Karsten Hopp fae23d
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp fae23d
Mime-Version: 1.0
Karsten Hopp fae23d
Content-Type: text/plain; charset=UTF-8
Karsten Hopp fae23d
Content-Transfer-Encoding: 8bit
Karsten Hopp fae23d
------------
Karsten Hopp fae23d
Karsten Hopp fae23d
Patch 7.3.1158
Karsten Hopp fae23d
Problem:    Crash when running test 86. (Jun Takimoto)
Karsten Hopp fae23d
Solution:   Define PY_SSIZE_T_CLEAN early. (Elimar Riesebieter)
Karsten Hopp fae23d
Files:	    src/if_python.c, src/if_python3.c
Karsten Hopp fae23d
Karsten Hopp fae23d
Karsten Hopp fae23d
*** ../vim-7.3.1157/src/if_python.c	2013-06-02 18:20:12.000000000 +0200
Karsten Hopp fae23d
--- src/if_python.c	2013-06-10 18:19:52.000000000 +0200
Karsten Hopp fae23d
***************
Karsten Hopp fae23d
*** 53,59 ****
Karsten Hopp fae23d
--- 53,66 ----
Karsten Hopp fae23d
  # undef _XOPEN_SOURCE	/* pyconfig.h defines it as well. */
Karsten Hopp fae23d
  #endif
Karsten Hopp fae23d
  
Karsten Hopp fae23d
+ #define PY_SSIZE_T_CLEAN
Karsten Hopp fae23d
+ 
Karsten Hopp fae23d
  #include <Python.h>
Karsten Hopp fae23d
+ 
Karsten Hopp fae23d
+ #if !defined(PY_VERSION_HEX) || PY_VERSION_HEX < 0x02050000
Karsten Hopp fae23d
+ # undef PY_SSIZE_T_CLEAN
Karsten Hopp fae23d
+ #endif
Karsten Hopp fae23d
+ 
Karsten Hopp fae23d
  #if defined(MACOS) && !defined(MACOS_X_UNIX)
Karsten Hopp fae23d
  # include "macglue.h"
Karsten Hopp fae23d
  # include <CodeFragments.h>
Karsten Hopp fae23d
***************
Karsten Hopp fae23d
*** 61,70 ****
Karsten Hopp fae23d
  #undef main /* Defined in python.h - aargh */
Karsten Hopp fae23d
  #undef HAVE_FCNTL_H /* Clash with os_win32.h */
Karsten Hopp fae23d
  
Karsten Hopp fae23d
- #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000
Karsten Hopp fae23d
- # define PY_SSIZE_T_CLEAN
Karsten Hopp fae23d
- #endif
Karsten Hopp fae23d
- 
Karsten Hopp fae23d
  #define PyBytes_FromString PyString_FromString
Karsten Hopp fae23d
  #define PyBytes_Check PyString_Check
Karsten Hopp fae23d
  
Karsten Hopp fae23d
--- 68,73 ----
Karsten Hopp fae23d
*** ../vim-7.3.1157/src/if_python3.c	2013-06-02 18:20:12.000000000 +0200
Karsten Hopp fae23d
--- src/if_python3.c	2013-06-10 18:24:36.000000000 +0200
Karsten Hopp fae23d
***************
Karsten Hopp fae23d
*** 24,32 ****
Karsten Hopp fae23d
  
Karsten Hopp fae23d
  /* uncomment this if used with the debug version of python */
Karsten Hopp fae23d
  /* #define Py_DEBUG */
Karsten Hopp fae23d
! /* Note: most of time you can add -DPy_DEBUG to CFLAGS in place of uncommenting 
Karsten Hopp fae23d
   */
Karsten Hopp fae23d
! /* uncomment this if used with the debug version of python, but without its 
Karsten Hopp fae23d
   * allocator */
Karsten Hopp fae23d
  /* #define Py_DEBUG_NO_PYMALLOC */
Karsten Hopp fae23d
  
Karsten Hopp fae23d
--- 24,32 ----
Karsten Hopp fae23d
  
Karsten Hopp fae23d
  /* uncomment this if used with the debug version of python */
Karsten Hopp fae23d
  /* #define Py_DEBUG */
Karsten Hopp fae23d
! /* Note: most of time you can add -DPy_DEBUG to CFLAGS in place of uncommenting
Karsten Hopp fae23d
   */
Karsten Hopp fae23d
! /* uncomment this if used with the debug version of python, but without its
Karsten Hopp fae23d
   * allocator */
Karsten Hopp fae23d
  /* #define Py_DEBUG_NO_PYMALLOC */
Karsten Hopp fae23d
  
Karsten Hopp fae23d
***************
Karsten Hopp fae23d
*** 61,67 ****
Karsten Hopp fae23d
--- 61,70 ----
Karsten Hopp fae23d
  # undef _XOPEN_SOURCE	/* pyconfig.h defines it as well. */
Karsten Hopp fae23d
  #endif
Karsten Hopp fae23d
  
Karsten Hopp fae23d
+ #define PY_SSIZE_T_CLEAN
Karsten Hopp fae23d
+ 
Karsten Hopp fae23d
  #include <Python.h>
Karsten Hopp fae23d
+ 
Karsten Hopp fae23d
  #if defined(MACOS) && !defined(MACOS_X_UNIX)
Karsten Hopp fae23d
  # include "macglue.h"
Karsten Hopp fae23d
  # include <CodeFragments.h>
Karsten Hopp fae23d
***************
Karsten Hopp fae23d
*** 69,78 ****
Karsten Hopp fae23d
  #undef main /* Defined in python.h - aargh */
Karsten Hopp fae23d
  #undef HAVE_FCNTL_H /* Clash with os_win32.h */
Karsten Hopp fae23d
  
Karsten Hopp fae23d
- #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000
Karsten Hopp fae23d
- # define PY_SSIZE_T_CLEAN
Karsten Hopp fae23d
- #endif
Karsten Hopp fae23d
- 
Karsten Hopp fae23d
  /* The "surrogateescape" error handler is new in Python 3.1 */
Karsten Hopp fae23d
  #if PY_VERSION_HEX >= 0x030100f0
Karsten Hopp fae23d
  # define CODEC_ERROR_HANDLER "surrogateescape"
Karsten Hopp fae23d
--- 72,77 ----
Karsten Hopp fae23d
*** ../vim-7.3.1157/src/version.c	2013-06-10 16:35:11.000000000 +0200
Karsten Hopp fae23d
--- src/version.c	2013-06-10 18:25:01.000000000 +0200
Karsten Hopp fae23d
***************
Karsten Hopp fae23d
*** 730,731 ****
Karsten Hopp fae23d
--- 730,733 ----
Karsten Hopp fae23d
  {   /* Add new patch number below this line */
Karsten Hopp fae23d
+ /**/
Karsten Hopp fae23d
+     1158,
Karsten Hopp fae23d
  /**/
Karsten Hopp fae23d
Karsten Hopp fae23d
-- 
Karsten Hopp fae23d
Never eat yellow snow.
Karsten Hopp fae23d
Karsten Hopp fae23d
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp fae23d
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp fae23d
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp fae23d
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///