In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/45d67106f8acd7bf2229260c4804817a9c1c2578?hp=c2b4244a1cd5bb89e0df552475efbb59ea37e706>
- Log ----------------------------------------------------------------- commit 45d67106f8acd7bf2229260c4804817a9c1c2578 Author: Karl Williamson <[email protected]> Date: Thu Sep 14 21:58:14 2017 -0600 Parenthesize macro arguments to ninstr() This did not work properly if called if expressions for arguments. Could someone write a porting test to look for non-parenthesized macro arguments involved in expressions M util.h commit 98553364dcb001006e8560509e2865af4f61a356 Author: Karl Williamson <[email protected]> Date: Mon Sep 11 12:30:14 2017 -0600 t/run/locale.t: Move function call I think its better form to call the function after the 'use' statement that imported the function being called, even though it's available throughout the enclosing block. M t/run/locale.t commit 3ae5cd075d1d8f700862413406a49dc4a2f4a8ea Author: Karl Williamson <[email protected]> Date: Mon Sep 11 09:48:33 2017 -0600 locale.c: Show how the number '112' was derived It's unclear why the code uses this number, so expand out the expression that yields that, which makes it clearer. M locale.c ----------------------------------------------------------------------- Summary of changes: locale.c | 2 +- t/run/locale.t | 2 +- util.h | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/locale.c b/locale.c index 4189a6248d..f4a16e4d4d 100644 --- a/locale.c +++ b/locale.c @@ -3045,7 +3045,7 @@ Perl__is_cur_LC_category_utf8(pTHX_ int category) for (i = 0; i < 7 + 12; i++) { /* 7 days; 12 months */ formatted_time = my_strftime("%A %B %Z %p", - 0, 0, hour, dom, month, 112, 0, 0, is_dst); + 0, 0, hour, dom, month, 2012 - 1900, 0, 0, is_dst); if ( ! formatted_time || is_utf8_invariant_string((U8 *) formatted_time, 0)) { diff --git a/t/run/locale.t b/t/run/locale.t index 4a1ddef9f3..db75b444ce 100644 --- a/t/run/locale.t +++ b/t/run/locale.t @@ -148,8 +148,8 @@ EOF { fresh_perl_is(<<'EOF', ",,", {}, -print localeconv()->{decimal_point}; use POSIX; +print localeconv()->{decimal_point}; use locale; print localeconv()->{decimal_point}; EOF diff --git a/util.h b/util.h index 6b63d90e4f..0b6b59a6a7 100644 --- a/util.h +++ b/util.h @@ -243,7 +243,8 @@ means arg not present, 1 is empty string/null byte */ #ifdef HAS_MEMMEM # define ninstr(big, bigend, little, lend) \ - ((char *) memmem(big, bigend - big, little, lend - little)) + ((char *) memmem((big), (bigend) - (big), \ + (little), (lend) - (little))) #endif #if defined(HAS_MKSTEMP) && defined(PERL_CORE) -- Perl5 Master Repository
