mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
updated for version 7.3.267
Problem: Ruby on Mac OS X 10.7 may crash. Solution: Avoid alloc(0). (Bjorn Winckler)
This commit is contained in:
parent
673214bb7d
commit
3f5f795f76
@ -761,11 +761,19 @@ static VALUE vim_message(VALUE self UNUSED, VALUE str)
|
|||||||
char *buff, *p;
|
char *buff, *p;
|
||||||
|
|
||||||
str = rb_obj_as_string(str);
|
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));
|
buff = ALLOCA_N(char, RSTRING_LEN(str));
|
||||||
strcpy(buff, RSTRING_PTR(str));
|
strcpy(buff, RSTRING_PTR(str));
|
||||||
p = strchr(buff, '\n');
|
p = strchr(buff, '\n');
|
||||||
if (p) *p = '\0';
|
if (p) *p = '\0';
|
||||||
MSG(buff);
|
MSG(buff);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MSG("");
|
||||||
|
}
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -709,6 +709,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
267,
|
||||||
/**/
|
/**/
|
||||||
266,
|
266,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user