diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-10-23 19:19:51 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-10-25 10:59:55 +0000 |
commit | 7ff06cc7c932ea693a5ea6b94f95570a9d4548b5 (patch) | |
tree | a8a629f166cc106347aa8458b66ed601066c0eb6 /sv.c | |
parent | af08d52dcc0fecaf93b69b919878fb338f1cd6de (diff) | |
download | perl-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 */ |