develooper Front page | perl.perl5.porters | Postings from June 2014

Re: [perl.git] branch smoke-me/jhi/binary, created. v5.21.0-250-g6967578

From:
bulk88
Date:
June 3, 2014 17:28
Subject:
Re: [perl.git] branch smoke-me/jhi/binary, created. v5.21.0-250-g6967578
Message ID:
BLU436-SMTP150CAB7A75C46500DBD66CADF230@phx.gbl
Jarkko Hietaniemi wrote:
> In perl.git, the branch smoke-me/jhi/binary has been created
> 
> <http://perl5.git.perl.org/perl.git/commitdiff/6967578d557f8f962ecc5e926e4169b05a89e602?hp=0000000000000000000000000000000000000000>
> 
>         at  6967578d557f8f962ecc5e926e4169b05a89e602 (commit)
> 
> - Log -----------------------------------------------------------------
> commit 6967578d557f8f962ecc5e926e4169b05a89e602
> Author: Jarkko Hietaniemi <jhi@iki.fi>
> Date:   Mon Jun 2 09:57:28 2014 -0400
> 
>     38d96942 missed a side-effect in PerlIO_open flags parsing.
>     
>     The mode++ was essential in allowing 'rb' for the PerlIO_open() flags.
>     Strangely enough, nothing else so far than Compress::Bzip2 caught that:
>     https://rt.perl.org/Ticket/Display.html?id=122012
>     Without the mode++ the 'b' was left unprocessed and this caused
>     the oflags to become bogus.
>     
>     There's no "unit testing" of PerlIO as such.  Sigh.
>     
>     While doing this, realized that for the "O_BINARY vs O_TEXT" it's
>     probably the clearest to test for the non-zero-ness of them.
> -----------------------------------------------------------------------
> 
> --
> Perl5 Master Repository

Maybe its better to revert all the Coverity fixes for this area, since 
the Coverity complaint was unreachable code and not something more serious.

-------------------------
+            /* bit-and:ing with zero O_BINARY or O_TEXT would be 
useless. */
+#  if O_BINARY != 0
             if (mode & O_BINARY)
                 o->op_private |= OPpOPEN_IN_RAW;
-           else if (mode & O_TEXT)
+#  endif
+#  if O_TEXT != 0
+           if (mode & O_TEXT)
                 o->op_private |= OPpOPEN_IN_CRLF;
+#  endif
--------------------------
The #ifs are bizarre and trying too hard.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About