aboutsummaryrefslogtreecommitdiffstats
path: root/error.c
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-27 12:07:43 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-27 12:07:43 +0000
commitee3ea93fbaa1e7a1ef09b4b4cc45c67d89c0f738 (patch)
tree107b6299c92cefc50928b8f86f737aa087f177a9 /error.c
parentb575b934d80216969543535b0a05ffaab8ea030b (diff)
downloadruby-ee3ea93fbaa1e7a1ef09b4b4cc45c67d89c0f738.tar.gz
Send the backtrace of the circular require warning as a single String to Warning.warn
* load.c: send as a single string. * error.c: expose the string formatted by rb_warning as rb_warning_string(). * test/ruby/test_exception.rb: update tests. [ruby-core:80850] [Bug #13505] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r--error.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/error.c b/error.c
index 709fcf3612..5c21229cbd 100644
--- a/error.c
+++ b/error.c
@@ -268,6 +268,14 @@ rb_warning(const char *fmt, ...)
}
}
+VALUE
+rb_warning_string(const char *fmt, ...)
+{
+ with_warning_string(mesg, 0, fmt) {
+ }
+ return mesg;
+}
+
#if 0
void
rb_enc_warning(rb_encoding *enc, const char *fmt, ...)