This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
38d96942 missed a side-effect in PerlIO_open flags parsing.
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 2 Jun 2014 13:57:28 +0000 (09:57 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 3 Jun 2014 10:36:20 +0000 (06:36 -0400)
commit43e5477e1cb9b5aed5748aeeb8d72fe147e673a7
tree602c7ef697c541ee986d1bcaee14b399c5485a3a
parentcf6e31e92ce25aab729563d4e1451cbf65e5138b
38d96942 missed a side-effect in PerlIO_open flags parsing.

The mode++ was essential in allowing 'rb' for the PerlIO_open() flags.
Without the mode++ the 'b' was left unprocessed and this caused
the oflags to become bogus.

Compress::Bzip2 caught this: https://rt.perl.org/Ticket/Display.html?id=122012
(also Unicode::Map8, Text::Scan, and otehrs)

While doing this, realized that for the "O_BINARY versus O_TEXT" it's
probably the clearest to test for the non-zero-ness of those two flags.

(Is there any "unit testing" of PerlIO? In this case it would be:
 PerlIO_open -> PerlIO_openn -> PerlIOBuf_open -> PerlIOUnix_open ->
 PerlIOUnix_oflags with mode of "rb")
op.c
perl.h
perlio.c