From: Robin Barker Date: Mon, 10 Feb 2003 16:43:23 +0000 (+0000) Subject: [perl #20654] %*v02x considered invalid in printf X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f3583277f058a41c88989ac547f12b7065567d88;p=p5sagit%2Fp5-mst-13.2.git [perl #20654] %*v02x considered invalid in printf From: Robin Barker (via RT) Message-Id: p4raw-id: //depot/perl@18696 --- diff --git a/sv.c b/sv.c index 4ef0485..1caf879 100644 --- a/sv.c +++ b/sv.c @@ -8330,6 +8330,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV \d+\$ explicit format parameter index [-+ 0#]+ flags v|\*(\d+\$)?v vector with optional (optionally specified) arg + 0 flag (as above): repeated to allow "v02" \d+|\*(\d+\$)? width using optional (optionally specified) arg \.(\d*|\*(\d+\$)?) precision using optional (optionally specified) arg [hlqLV] size @@ -8395,6 +8396,8 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV } if (!asterisk) + if( *q == '0' ) + fill = *q++; EXPECT_NUMBER(q, width); if (vectorize) { diff --git a/t/op/sprintf.t b/t/op/sprintf.t index 2eaa2e4..e498c65 100755 --- a/t/op/sprintf.t +++ b/t/op/sprintf.t @@ -373,3 +373,5 @@ __END__ >%vp< >''< >%vp INVALID< >%vs,%d< >[1, 2, 3]< >1,2< >%v_< >''< >%v_ INVALID< +>%v#x< >''< >%v#x INVALID< +>%v02x< >"foo\n"< >66.6f.6f.0a<