summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-07-09 08:40:46 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-07-09 08:40:46 +0000
commit3c1d5b89c33546028fce534546b8e356369ee231 (patch)
treefb658b101bf9a045c488663f2cbc6b3a178bbd3e /sprintf.c
parent528b1f5237bc4e031228a27c00cdd679319f2472 (diff)
1.1b9_30
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sprintf.c b/sprintf.c
index 5bc5303..5817f19 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -350,7 +350,7 @@ f_sprintf(argc, argv)
s += 2;
bignum = 2;
}
- sprintf(fbuf, "%%%c", *p);
+ sprintf(fbuf, "%l%%c", *p);
sprintf(s, fbuf, v);
if (v < 0) {
char d = 0;
@@ -469,6 +469,7 @@ f_sprintf(argc, argv)
int v;
if (c == 'D') c = 'd';
+ if (c == 'O') c = 'o';
int_retry:
switch (TYPE(val)) {
case T_FIXNUM:
@@ -542,7 +543,7 @@ f_sprintf(argc, argv)
}
}
else {
- int max = 11;
+ int max = 12;
if ((flags & FPREC) && prec > max) max = prec;
if ((flags & FWIDTH) && width > max) max = width;
@@ -611,6 +612,9 @@ fmt_setup(buf, c, flags, width, prec)
int flags, width, prec;
{
*buf++ = '%';
+ if (strchr("doOXx", c)) {
+ *buf++ = 'l';
+ }
if (flags & FSHARP) *buf++ = '#';
if (flags & FPLUS) *buf++ = '+';
if (flags & FMINUS) *buf++ = '-';