summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-05-30 09:12:34 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-05-30 09:12:34 +0000
commitabfaac7a6cbdbfad9e7c05bc5ebcb4df57906fcb (patch)
tree4d406191345ff9f25e3a3c9ce5f85a3a13e6f7d1 /eval.c
parent4cd1cd7201757185e63a5a33181932a6670887ad (diff)
* ruby.c (proc_options): unexpected SecurityError happens when -T4.
* regex.c (re_compile_pattern): * \1 .. \9 should be backreferences always. * regex.c (re_match): backreferences corresponding to unclosed/unmatched parentheses should fail always. * string.c (rb_str_cat): use rb_str_buf_cat() if possible. [new] * string.c (rb_str_append): ditto. * string.c (rb_str_buf_cat): remove unnecessary check (type, taint, modify) to gain performance. * string.c (rb_str_buf_append): ditto. * string.c (rb_str_buf_new): buffering string function. [new] * string.c (rb_str_buf_append): ditto. * string.c (rb_str_buf_cat): ditto. * time.c (make_time_t): local time adjustment revised. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/eval.c b/eval.c
index cc21c7c606..1dbd43b2d1 100644
--- a/eval.c
+++ b/eval.c
@@ -15,6 +15,7 @@
#include "ruby.h"
#include "node.h"
#include "env.h"
+#include "util.h"
#include "rubysig.h"
#include <stdio.h>
@@ -1213,14 +1214,14 @@ compile_error(at)
VALUE str;
ruby_nerrs = 0;
- str = rb_str_new2("compile error");
+ str = rb_str_buf_new2("compile error");
if (at) {
- rb_str_cat2(str, " in ");
- rb_str_cat2(str, at);
+ rb_str_buf_cat2(str, " in ");
+ rb_str_buf_cat2(str, at);
}
- rb_str_cat(str, "\n", 1);
+ rb_str_buf_cat(str, "\n", 1);
if (!NIL_P(ruby_errinfo)) {
- rb_str_concat(str, ruby_errinfo);
+ rb_str_append(str, ruby_errinfo);
}
rb_exc_raise(rb_exc_new3(rb_eSyntaxError, str));
}
@@ -2351,9 +2352,7 @@ rb_eval(self, n)
case NODE_YIELD:
if (node->nd_stts) {
result = rb_eval(self, node->nd_stts);
- if (nd_type(node->nd_stts) == NODE_RESTARGS &&
- RARRAY(result)->len == 1)
- {
+ if (nd_type(node->nd_stts) == NODE_RESTARGS && RARRAY(result)->len == 1) {
result = RARRAY(result)->ptr[0];
}
}
@@ -6752,19 +6751,19 @@ method_inspect(method)
const char *s;
Data_Get_Struct(method, struct METHOD, data);
- str = rb_str_new2("#<");
+ str = rb_str_buf_new2("#<");
s = rb_class2name(CLASS_OF(method));
- rb_str_cat2(str, s);
- rb_str_cat2(str, ": ");
+ rb_str_buf_cat2(str, s);
+ rb_str_buf_cat2(str, ": ");
s = rb_class2name(data->oklass);
- rb_str_cat2(str, s);
- rb_str_cat2(str, "(");
+ rb_str_buf_cat2(str, s);
+ rb_str_buf_cat2(str, "(");
s = rb_class2name(data->klass);
- rb_str_cat2(str, s);
- rb_str_cat2(str, ")#");
+ rb_str_buf_cat2(str, s);
+ rb_str_buf_cat2(str, ")#");
s = rb_id2name(data->oid);
- rb_str_cat2(str, s);
- rb_str_cat2(str, ">");
+ rb_str_buf_cat2(str, s);
+ rb_str_buf_cat2(str, ">");
return str;
}