# HG changeset patch # User Bram Moolenaar # Date 1312479299 -7200 # Node ID ad404f2a4bfa5374e97f29335f41b7ef34cd6bfa # Parent 124a81f12ca4ba0f425f4b525ee0c872cb7bec8c updated for version 7.3.267 Problem: Ruby on Mac OS X 10.7 may crash. Solution: Avoid alloc(0). (Bjorn Winckler) diff --git a/src/if_ruby.c b/src/if_ruby.c --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -761,11 +761,19 @@ static VALUE vim_message(VALUE self UNUS 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); + 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; } diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -710,6 +710,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 267, +/**/ 266, /**/ 265,