summaryrefslogtreecommitdiff
path: root/source/ap/vim/patches/7.3.267
blob: d986e5036efabf1d8af7f7062d0287a53a6851d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
To: vim_dev@googlegroups.com
Subject: Patch 7.3.267
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.267
Problem:    Ruby on Mac OS X 10.7 may crash.
Solution:   Avoid alloc(0). (Bjorn Winckler)
Files:	    src/if_ruby.c


*** ../vim-7.3.266/src/if_ruby.c	2011-01-17 19:53:20.000000000 +0100
--- src/if_ruby.c	2011-08-04 18:57:43.000000000 +0200
***************
*** 761,771 ****
      char *buff, *p;
  
      str = rb_obj_as_string(str);
!     buff = ALLOCA_N(char, RSTRING_LEN(str));
!     strcpy(buff, RSTRING_PTR(str));
!     p = strchr(buff, '\n');
!     if (p) *p = '\0';
!     MSG(buff);
      return Qnil;
  }
  
--- 761,779 ----
      char *buff, *p;
  
      str = rb_obj_as_string(str);
!     if (RSTRING_LEN(str) > 0)
!     {
! 	/* Only do this when the string isn't empty, alloc(0) causes trouble. */
! 	buff = ALLOCA_N(char, RSTRING_LEN(str));
! 	strcpy(buff, RSTRING_PTR(str));
! 	p = strchr(buff, '\n');
! 	if (p) *p = '\0';
! 	MSG(buff);
!     }
!     else
!     {
! 	MSG("");
!     }
      return Qnil;
  }
  
*** ../vim-7.3.266/src/version.c	2011-07-27 18:25:40.000000000 +0200
--- src/version.c	2011-08-04 19:07:45.000000000 +0200
***************
*** 711,712 ****
--- 711,714 ----
  {   /* Add new patch number below this line */
+ /**/
+     267,
  /**/

-- 
There are 10 kinds of people: Those who understand binary and those who don't.

 /// 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    ///