In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/736a4fed846ed1fbe60d547de8f19357ec54aa41?hp=a0c4698cfb653ff369899b9f22b0de2b8e8f3bc2>
- Log ----------------------------------------------------------------- commit 736a4fed846ed1fbe60d547de8f19357ec54aa41 Author: Karl Williamson <[email protected]> Date: Tue Feb 7 10:00:19 2017 -0700 locale.c: Use only C89 legal C An array was being declared and initialized from a non-constant. Spotted by James Keenan ----------------------------------------------------------------------- Summary of changes: locale.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/locale.c b/locale.c index 5c1c552523..01962ea235 100644 --- a/locale.c +++ b/locale.c @@ -1505,10 +1505,10 @@ Perl__mem_collxfrm(pTHX_ const char *input_string, char * x; /* j's xfrm plus collation index */ STRLEN x_len; /* length of 'x' */ STRLEN trial_len = 1; + char cur_source[] = { '\0', '\0' }; - /* Create a 1 byte string of the current code point */ - char cur_source[] = { (char) j, '\0' }; - + /* Skip non-controls the first time through the loop. The + * controls in a UTF-8 locale are the L1 ones */ if (! try_non_controls && (PL_in_utf8_COLLATE_locale) ? ! isCNTRL_L1(j) : ! isCNTRL_LC(j)) @@ -1516,6 +1516,9 @@ Perl__mem_collxfrm(pTHX_ const char *input_string, continue; } + /* Create a 1-char string of the current code point */ + cur_source[0] = (char) j; + /* Then transform it */ x = _mem_collxfrm(cur_source, trial_len, &x_len, 0 /* The string is not in UTF-8 */); @@ -1671,9 +1674,10 @@ Perl__mem_collxfrm(pTHX_ const char *input_string, for (j = 1; j < 256; j++) { char * x; STRLEN x_len; + char cur_source[] = { '\0', '\0' }; - /* Create a 1-char string of the current code point. */ - char cur_source[] = { (char) j, '\0' }; + /* Create a 1-char string of the current code point */ + cur_source[0] = (char) j; /* Then transform it */ x = _mem_collxfrm(cur_source, 1, &x_len, FALSE); -- Perl5 Master Repository
