From: Gisle Aas Date: Mon, 12 Dec 2005 10:41:04 +0000 (+0000) Subject: Drop "v" prefix from sprintf("%vd", $^V). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=18eaf740981d16295448f4e0ae82e559be636a26;p=p5sagit%2Fp5-mst-13.2.git Drop "v" prefix from sprintf("%vd", $^V). The sprintf documentation has this example: printf "version is v%vd\n", $^V; and it printed 'version is vv5.9.3\n'. p4raw-id: //depot/perl@26326 --- diff --git a/sv.c b/sv.c index df957d5..e0165d4 100644 --- a/sv.c +++ b/sv.c @@ -8011,6 +8011,10 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV q++; /* skip past the rest of the %vd format */ eptr = (const char *) vecstr; elen = veclen; + if (elen && *eptr == 'v') { + eptr++; + elen--; + } vectorize=FALSE; goto string; } diff --git a/t/op/sprintf.t b/t/op/sprintf.t index 7d35cb2..6cd9ec3 100755 --- a/t/op/sprintf.t +++ b/t/op/sprintf.t @@ -241,6 +241,8 @@ __END__ >%+vd< >chr(1)< >+1< >%#vd< >chr(1)< >1< >%vd< >"\01\02\03"< >1.2.3< +>%vd< >v1.2.3< >1.2.3< +>%vd< >[version::qv("1.2.3")]< >1.2.3< >%v.3d< >"\01\02\03"< >001.002.003< >%0v3d< >"\01\02\03"< >001.002.003< >%-v3d< >"\01\02\03"< >1 .2 .3 <