From eda88b6dbdc5ca6a51d54f58740f0210e618beb7 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Thu, 9 Sep 1999 07:50:07 +0000 Subject: %#b in particular and %B in general were kaputt. p4raw-id: //depot/cfgperl@4111 --- sv.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sv.c') diff --git a/sv.c b/sv.c index 956f3b961a..f6a793c40a 100644 --- a/sv.c +++ b/sv.c @@ -4959,6 +4959,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; @@ -5033,8 +5034,10 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV dig = uv & 1; *--eptr = '0' + dig; } while (uv >>= 1); - if (alt && *eptr != '0') - *--eptr = '0'; + if (alt) { + esignbuf[esignlen++] = '0'; + esignbuf[esignlen++] = c; /* 'b' or 'B' */ + } break; default: /* it had better be ten or less */ do { -- cgit v1.2.1