summaryrefslogtreecommitdiffstats
path: root/sprintf.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-06-07 08:22:42 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-06-07 08:22:42 +0000
commit0cbd59ec60de5faf89c24dc4e0635b4e6dacfa06 (patch)
treeebec2258661db268552635e00841de994b1918a0 /sprintf.c
parent3e943ad7c0c448437487454e2f4513339addfd61 (diff)
* parse.y (parser_yylex): allow ';;' to be block terminator in
place of 'end'. [highly experimental] * misc/ruby-mode.el (ruby-block-end-re): allow ';;' for a negative indent trigger. [highly experimental] * parse.y (parser_yylex): "respond_to?:foo" should be interpreted as "respond_to? :foo" at the command level. [ruby-talk:144303] * sprintf.c (rb_f_sprintf): raise exception on debug mode (-d), not verbose mode (-w/-w). [ruby-core:05123] * sprintf.c (rb_f_sprintf): warn always on verbose mode. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sprintf.c b/sprintf.c
index 0b7dd2838..59195450b 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -770,8 +770,10 @@ rb_f_sprintf(argc, argv)
sprint_exit:
/* XXX - We cannot validiate the number of arguments if (digit)$ style used.
*/
- if (RTEST(ruby_verbose) && posarg >= 0 && nextarg < argc) {
- rb_raise(rb_eArgError, "too many arguments for format string");
+ if (posarg >= 0 && nextarg < argc) {
+ const char *mesg = "too many arguments for format string";
+ if (RTEST(ruby_debug)) rb_raise(rb_eArgError, mesg);
+ if (RTEST(ruby_verbose)) rb_warn(mesg);
}
rb_str_resize(result, blen);