summaryrefslogtreecommitdiff
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
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
-rw-r--r--ChangeLog5
-rw-r--r--ext/readline/readline.c8
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 <nagachika00@gmail.com>
+
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ fix typos.
+
Mon Jan 9 20:55:34 2012 Narihiro Nakamura <authornari@gmail.com>
* 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';
}