aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-10 06:14:42 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-10 06:14:42 +0000
commitb04814bf711ed170c674ca874d28dba8faed9484 (patch)
tree3928eb9c5b7ce4590c4e59753b885ba15bd8d48b
parent931459d974390436161aa98fa5a4fc94e00c3951 (diff)
downloadruby-b04814bf711ed170c674ca874d28dba8faed9484.tar.gz
* ext/readline/readline.c (readline_attempted_completion_function):
use rb_memerror(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/readline/readline.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index eae82b3266..c61b6bb811 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Jan 10 15:13:58 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/readline/readline.c (readline_attempted_completion_function):
+ use rb_memerror().
+
Tue Jan 10 12:49:42 2012 NARUSE, Yui <naruse@ruby-lang.org>
* gc.c: in fact, i686-linux doesn't need to define _XOPEN_SOURCE 600.
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index d00fc049ac..423e58508b 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -672,7 +672,7 @@ readline_attempted_completion_function(const char *text, int start, int end)
matches = RARRAY_LEN(ary);
if (matches == 0) return NULL;
result = (char**)malloc((matches + 2)*sizeof(char*));
- if (result == NULL) rb_raise(rb_eNoMemError, "failed to allocate memory");
+ if (result == NULL) rb_memerror();
for (i = 0; i < matches; i++) {
temp = rb_obj_as_string(RARRAY_PTR(ary)[i]);
result[i + 1] = (char*)malloc(RSTRING_LEN(temp) + 1);