From: Dave Mitchell Date: Sun, 17 Jul 2005 19:02:10 +0000 (+0000) Subject: change #25129 was overzealous in delaying the call to ckWARN X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ce44635a98097a8f9f8acc0fc8393ebd5524dbdf;p=p5sagit%2Fp5-mst-13.2.git change #25129 was overzealous in delaying the call to ckWARN p4raw-link: @25129 on //depot/perl: 041457d90dbb6fb79a72c7a8462f01423f2daa09 p4raw-id: //depot/perl@25159 --- diff --git a/doio.c b/doio.c index 61a5371..e9c40a7 100644 --- a/doio.c +++ b/doio.c @@ -566,8 +566,9 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw, } } if (!fp) { - if (IoTYPE(io) == IoTYPE_RDONLY && strchr(name, '\n') - && ckWARN(WARN_NEWLINE) + if (IoTYPE(io) == IoTYPE_RDONLY && ckWARN(WARN_NEWLINE) + && strchr(name, '\n') + ) Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "open"); goto say_false; @@ -1394,7 +1395,7 @@ Perl_my_stat(pTHX) s = SvPVX_const(PL_statname); /* s now NUL-terminated */ PL_laststype = OP_STAT; PL_laststatval = PerlLIO_stat(s, &PL_statcache); - if (PL_laststatval < 0 && strchr(s, '\n') && ckWARN(WARN_NEWLINE)) + if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && strchr(s, '\n')) Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "stat"); return PL_laststatval; } diff --git a/pp_hot.c b/pp_hot.c index 35558f1..1e3d5ea 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1611,8 +1611,8 @@ Perl_do_readline(pTHX) const STRLEN len = SvCUR(sv) - offset; const U8 *f; - if (!Perl_is_utf8_string_loc(aTHX_ s, len, &f) - && ckWARN(WARN_UTF8)) + if (ckWARN(WARN_UTF8) && + !Perl_is_utf8_string_loc(aTHX_ s, len, &f)) /* Emulate :encoding(utf8) warning in the same case. */ Perl_warner(aTHX_ packWARN(WARN_UTF8), "utf8 \"\\x%02X\" does not map to Unicode", diff --git a/toke.c b/toke.c index ae56a6f..19bac4f 100644 --- a/toke.c +++ b/toke.c @@ -3515,7 +3515,7 @@ Perl_yylex(pTHX) OPERATOR(','); if (tmp == '~') PMop(OP_MATCH); - if (tmp && isSPACE(*s) && strchr("+-*/%.^&|<",tmp) && ckWARN(WARN_SYNTAX)) + if (tmp && isSPACE(*s) && ckWARN(WARN_SYNTAX) && strchr("+-*/%.^&|<",tmp)) Perl_warner(aTHX_ packWARN(WARN_SYNTAX), "Reversed %c= operator",(int)tmp); s--; if (PL_expect == XSTATE && isALPHA(tmp) && @@ -3685,8 +3685,8 @@ Perl_yylex(pTHX) else if (*s == '{') { char *t; PL_tokenbuf[0] = '%'; - if (strEQ(PL_tokenbuf+1, "SIG") && (t = strchr(s, '}')) - && (t = strchr(t, '=')) && ckWARN(WARN_SYNTAX)) + if (strEQ(PL_tokenbuf+1, "SIG") && ckWARN(WARN_SYNTAX) + && (t = strchr(s, '}')) && (t = strchr(t, '='))) { char tmpbuf[sizeof PL_tokenbuf]; for (t++; isSPACE(*t); t++) ;