summaryrefslogtreecommitdiff
path: root/ext/readline
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-09 14:38:52 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-09 14:38:52 +0000
commit41889c5adc046b4842120e1f535f627c30d721a8 (patch)
tree63102faf53d2789ce64adc2d0d83035bf2816f08 /ext/readline
parentb78bddee35fa426bf9286bcb3af4170282369a91 (diff)
* 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
Diffstat (limited to 'ext/readline')
-rw-r--r--ext/readline/readline.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index c87afcb..fa164ae 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';
}