From 41889c5adc046b4842120e1f535f627c30d721a8 Mon Sep 17 00:00:00 2001 From: nagachika Date: Mon, 9 Jan 2012 14:38:52 +0000 Subject: * ext/readline/readline.c (readline_attempted_completion_function): fix typos. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ext/readline/readline.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index dffa7c3d27..ccc198f198 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Jan 9 23:37:43 2012 CHIKANAGA Tomoyuki + + * ext/readline/readline.c (readline_attempted_completion_function): + fix typos. + Mon Jan 9 20:55:34 2012 Narihiro Nakamura * gc.c : don't embed struct heaps_slot to a heap block because it diff --git a/ext/readline/readline.c b/ext/readline/readline.c index c87afcb18b..fa164aec9f 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -670,13 +670,13 @@ readline_attempted_completion_function(const char *text, int start, int end) if (TYPE(ary) != T_ARRAY) ary = rb_Array(ary); matches = RARRAY_LEN(ary); - if (matches == NULL) rb_mem_error(); + if (matches == NULL) rb_memerror(); result = (char**)malloc((matches + 2)*sizeof(char*)); - if (result == NULL) rb_raise(rb_eNoMemError, "%s"); + if (result == NULL) rb_raise(rb_eNoMemError, "failed to allocate memory"); for (i = 0; i < matches; i++) { temp = rb_obj_as_string(RARRAY_PTR(ary)[i]); result[i + 1] = (char*)malloc(RSTRING_LEN(temp) + 1); - if (result[i + 1] == NULL) rb_mem_error(); + if (result[i + 1] == NULL) rb_memerror(); strcpy(result[i + 1], RSTRING_PTR(temp)); } result[matches + 1] = NULL; @@ -709,7 +709,7 @@ readline_attempted_completion_function(const char *text, int start, int end) i++; } result[0] = (char*)malloc(low + 1); - if (result[0] == NULL) rb_mem_error(); + if (result[0] == NULL) rb_memerror(); strncpy(result[0], result[1], low); result[0][low] = '\0'; } -- cgit v1.2.3