| 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 |
| |
| |
| |
| |
| |
| *** 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; |
| } |
| |
| |
| |
| |
| *** 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 /// |