summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-10-23 19:19:51 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-10-25 10:59:55 +0000
commit7ff06cc7c932ea693a5ea6b94f95570a9d4548b5 (patch)
treea8a629f166cc106347aa8458b66ed601066c0eb6 /sv.c
parentaf08d52dcc0fecaf93b69b919878fb338f1cd6de (diff)
downloadperl-7ff06cc7c932ea693a5ea6b94f95570a9d4548b5.tar.gz
Add a %B sprintf format
Subject: Re: [perl #40583] sprintf "%#04X" also uppercases the 0x-prefix Message-ID: <20061023171951.GA3262@plum.flirble.org> (plus docs) p4raw-id: //depot/perl@29104
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index f5d9cb63da..e38d4b784e 100644
--- a/sv.c
+++ b/sv.c
@@ -9039,6 +9039,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
base = 10;
goto uns_integer;
+ case 'B':
case 'b':
base = 2;
goto uns_integer;
@@ -9132,7 +9133,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
} while (uv >>= 1);
if (tempalt) {
esignbuf[esignlen++] = '0';
- esignbuf[esignlen++] = 'b';
+ esignbuf[esignlen++] = c;
}
break;
default: /* it had better be ten or less */