Feature #12944 » 0001-Restore-behavior-of-Kernel-warn-accepting-arrays-arg.patch
error.c | ||
---|---|---|
rb_warn_m(int argc, VALUE *argv, VALUE exc)
|
||
{
|
||
if (!NIL_P(ruby_verbose) && argc > 0) {
|
||
int i;
|
||
VALUE str;
|
||
for (i = 0; i < argc; i++) {
|
||
str = rb_obj_as_string(argv[i]);
|
||
if (RSTRING_LEN(str) == 0) {
|
||
str = rb_default_rs;
|
||
}
|
||
else if (!rb_str_end_with_asciichar(str, '\n')) {
|
||
str = rb_str_cat(rb_str_dup(str), "\n", 1);
|
||
}
|
||
rb_write_warning_str(str);
|
||
str = rb_ary_new_from_values(argc, argv);
|
||
str = rb_ary_join(str, rb_str_new("\n", 1));
|
||
if (RSTRING_LEN(str) == 0 || !rb_str_end_with_asciichar(str, '\n')) {
|
||
rb_str_cat(str, "\n", 1);
|
||
}
|
||
rb_write_warning_str(str);
|
||
}
|
||
return Qnil;
|
||
}
|
- « Previous
- 1
- …
- 4
- 5
- 6
- Next »