From: Tsutomu IKEGAMI Date: Fri, 17 Jun 2005 17:55:10 +0000 (+0900) Subject: Re: [perl #36310] sv_vcatpvfn() fails on some (very limited) situations X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7af36d83c0adcbdfcd87806abf6e33bf0c9a61db;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #36310] sv_vcatpvfn() fails on some (very limited) situations Message-Id: <20050617.175510.21285350.t-ikegami@aist.go.jp> p4raw-id: //depot/perl@24916 --- diff --git a/sv.c b/sv.c index 4a62adb..47ae295 100644 --- a/sv.c +++ b/sv.c @@ -8847,7 +8847,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV #ifndef USE_LONG_DOUBLE /* special-case "%.[gf]" */ - if ( patlen <= 5 && pat[0] == '%' && pat[1] == '.' + if ( !args && patlen <= 5 && pat[0] == '%' && pat[1] == '.' && (pat[patlen-1] == 'g' || pat[patlen-1] == 'f') ) { unsigned digits = 0; const char *pp; @@ -8858,9 +8858,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV if (pp - pat == (int)patlen - 1) { NV nv; - if (args) - nv = (NV)va_arg(*args, double); - else if (svix < svmax) + if (svix < svmax) nv = SvNV(*svargs); else return; @@ -8937,7 +8935,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV STRLEN have; STRLEN need; STRLEN gap; - const char *dotstr = "."; + const char *dotstr = "."; STRLEN dotstrlen = 1; I32 efix = 0; /* explicit format parameter index */ I32 ewix = 0; /* explicit width index */