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