It would be better to merge this and (7/?) into one patch.

# HG changeset patch
# User ZyX <[email protected]>
# Date 1369556544 -14400
# Node ID dacaaf15b8c8f00d0d2bb0c9fb4972608844cc4d
# Parent  3fb04fcf34ebf32f217f724f85064879e29b7fe4
Fix SEGV

diff -r 3fb04fcf34eb -r dacaaf15b8c8 src/if_py_both.h
--- a/src/if_py_both.h  Sun May 26 11:14:08 2013 +0400
+++ b/src/if_py_both.h  Sun May 26 12:22:24 2013 +0400
@@ -3397,7 +3397,8 @@
 BufferAttr(BufferObject *self, char *name)
 {
     if (strcmp(name, "name") == 0)
-       return PyString_FromString((char *) self->buf->b_ffname);
+       return PyString_FromString((self->buf->b_ffname == NULL
+                                   ? "" : (char *) self->buf->b_ffname));
     else if (strcmp(name, "number") == 0)
        return Py_BuildValue(Py_ssize_t_fmt, self->buf->b_fnum);
     else if (strcmp(name, "vars") == 0)

-- 
-- 
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/groups/opt_out.


*** /tmp/extdiff.S_iSLn/vim.3fb04fcf34eb/src/if_py_both.h	2013-05-26 12:27:00.173599266 +0400
--- vim.dacaaf15b8c8/src/if_py_both.h	2013-05-26 12:27:00.179599208 +0400
***************
*** 3397,3403 ****
  BufferAttr(BufferObject *self, char *name)
  {
      if (strcmp(name, "name") == 0)
! 	return PyString_FromString((char *) self->buf->b_ffname);
      else if (strcmp(name, "number") == 0)
  	return Py_BuildValue(Py_ssize_t_fmt, self->buf->b_fnum);
      else if (strcmp(name, "vars") == 0)
--- 3397,3404 ----
  BufferAttr(BufferObject *self, char *name)
  {
      if (strcmp(name, "name") == 0)
! 	return PyString_FromString((self->buf->b_ffname == NULL
! 				    ? "" : (char *) self->buf->b_ffname));
      else if (strcmp(name, "number") == 0)
  	return Py_BuildValue(Py_ssize_t_fmt, self->buf->b_fnum);
      else if (strcmp(name, "vars") == 0)

Raspunde prin e-mail lui