This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix *printf %ld handling for microperl (and other obscure platforms)
authorNicholas Clark <nick@ccl4.org>
Wed, 23 Mar 2011 12:18:20 +0000 (12:18 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 28 Mar 2011 09:21:48 +0000 (10:21 +0100)
07208e09d4435b4e accidentally moved the implicit q = q + 1 into conditionally
compiled code, which is compiled most everywhere else, except miniperl. Without
the increment of q, formats such as 'ld' were not being recognised as formats.
This was noticed because the tokeniser implements __LINE__ by converting to a
string using %ld.

sv.c

diff --git a/sv.c b/sv.c
index 9351076..9ea0b50 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -10375,8 +10375,9 @@ Perl_sv_vcatpvfn(pTHX_ SV *const sv, const char *const pat, const STRLEN patlen,
            break;
 #endif
        case 'l':
+           ++q;
 #if defined(HAS_QUAD) || defined(HAS_LONG_DOUBLE)
-           if (*++q == 'l') {  /* lld, llf */
+           if (*q == 'l') {    /* lld, llf */
                intsize = 'q';
                ++q;
            }