Karsten Hopp e923a2
To: vim_dev@googlegroups.com
Karsten Hopp e923a2
Subject: Patch 7.3.267
Karsten Hopp e923a2
Fcc: outbox
Karsten Hopp e923a2
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp e923a2
Mime-Version: 1.0
Karsten Hopp e923a2
Content-Type: text/plain; charset=UTF-8
Karsten Hopp e923a2
Content-Transfer-Encoding: 8bit
Karsten Hopp e923a2
------------
Karsten Hopp e923a2
Karsten Hopp e923a2
Patch 7.3.267
Karsten Hopp e923a2
Problem:    Ruby on Mac OS X 10.7 may crash.
Karsten Hopp e923a2
Solution:   Avoid alloc(0). (Bjorn Winckler)
Karsten Hopp e923a2
Files:	    src/if_ruby.c
Karsten Hopp e923a2
Karsten Hopp e923a2
Karsten Hopp e923a2
*** ../vim-7.3.266/src/if_ruby.c	2011-01-17 19:53:20.000000000 +0100
Karsten Hopp e923a2
--- src/if_ruby.c	2011-08-04 18:57:43.000000000 +0200
Karsten Hopp e923a2
***************
Karsten Hopp e923a2
*** 761,771 ****
Karsten Hopp e923a2
      char *buff, *p;
Karsten Hopp e923a2
  
Karsten Hopp e923a2
      str = rb_obj_as_string(str);
Karsten Hopp e923a2
!     buff = ALLOCA_N(char, RSTRING_LEN(str));
Karsten Hopp e923a2
!     strcpy(buff, RSTRING_PTR(str));
Karsten Hopp e923a2
!     p = strchr(buff, '\n');
Karsten Hopp e923a2
!     if (p) *p = '\0';
Karsten Hopp e923a2
!     MSG(buff);
Karsten Hopp e923a2
      return Qnil;
Karsten Hopp e923a2
  }
Karsten Hopp e923a2
  
Karsten Hopp e923a2
--- 761,779 ----
Karsten Hopp e923a2
      char *buff, *p;
Karsten Hopp e923a2
  
Karsten Hopp e923a2
      str = rb_obj_as_string(str);
Karsten Hopp e923a2
!     if (RSTRING_LEN(str) > 0)
Karsten Hopp e923a2
!     {
Karsten Hopp e923a2
! 	/* Only do this when the string isn't empty, alloc(0) causes trouble. */
Karsten Hopp e923a2
! 	buff = ALLOCA_N(char, RSTRING_LEN(str));
Karsten Hopp e923a2
! 	strcpy(buff, RSTRING_PTR(str));
Karsten Hopp e923a2
! 	p = strchr(buff, '\n');
Karsten Hopp e923a2
! 	if (p) *p = '\0';
Karsten Hopp e923a2
! 	MSG(buff);
Karsten Hopp e923a2
!     }
Karsten Hopp e923a2
!     else
Karsten Hopp e923a2
!     {
Karsten Hopp e923a2
! 	MSG("");
Karsten Hopp e923a2
!     }
Karsten Hopp e923a2
      return Qnil;
Karsten Hopp e923a2
  }
Karsten Hopp e923a2
  
Karsten Hopp e923a2
*** ../vim-7.3.266/src/version.c	2011-07-27 18:25:40.000000000 +0200
Karsten Hopp e923a2
--- src/version.c	2011-08-04 19:07:45.000000000 +0200
Karsten Hopp e923a2
***************
Karsten Hopp e923a2
*** 711,712 ****
Karsten Hopp e923a2
--- 711,714 ----
Karsten Hopp e923a2
  {   /* Add new patch number below this line */
Karsten Hopp e923a2
+ /**/
Karsten Hopp e923a2
+     267,
Karsten Hopp e923a2
  /**/
Karsten Hopp e923a2
Karsten Hopp e923a2
-- 
Karsten Hopp e923a2
There are 10 kinds of people: Those who understand binary and those who don't.
Karsten Hopp e923a2
Karsten Hopp e923a2
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp e923a2
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp e923a2
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp e923a2
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///