summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-22 06:48:18 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-22 06:48:18 +0000
commit959d5febcf0cdd2f4d81a1bb91bcd8d9fee83f2f (patch)
tree2a3fe02c8a124b8e603ac1e2aa1690dc5c322885 /sprintf.c
parentd0129370f07f3fcdcb18b9788161abdbbf230325 (diff)
* class.c (rb_mod_clone): should not copy class name, since clone
should remain anonymous. * eval.c (rb_call0): self in a block given to define_method now be switched to the receiver of the method. * eval.c (proc_invoke): added new parameter to allow self switching. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sprintf.c b/sprintf.c
index d3acb56..fe53d6b 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -352,6 +352,7 @@ rb_f_sprintf(argc, argv)
case 'x':
case 'X':
case 'b':
+ case 'B':
case 'u':
{
volatile VALUE val = GETARG();
@@ -371,6 +372,7 @@ rb_f_sprintf(argc, argv)
case 'x':
case 'X':
case 'b':
+ case 'B':
case 'u':
default:
if (flags&(FPLUS|FSPACE)) sign = 1;
@@ -381,6 +383,7 @@ rb_f_sprintf(argc, argv)
else if (*p == 'x') prefix = "0x";
else if (*p == 'X') prefix = "0X";
else if (*p == 'b') prefix = "0b";
+ else if (*p == 'B') prefix = "0B";
if (prefix) {
width -= strlen(prefix);
}
@@ -410,7 +413,7 @@ rb_f_sprintf(argc, argv)
if (*p == 'u' || *p == 'd' || *p == 'i') base = 10;
else if (*p == 'x' || *p == 'X') base = 16;
else if (*p == 'o') base = 8;
- else if (*p == 'b') base = 2;
+ else if (*p == 'b' || *p == 'B') base = 2;
if (!bignum) {
if (base == 2) {
val = rb_int2big(v);