Skip to content

Commit

Permalink
Make :utf8 and :bytes MULTIARG
Browse files Browse the repository at this point in the history
PerlIO layer types have this property that flags if they can accept
multiple arguments or only one. Unfortunately, this always checks the
uppermost layer that has an Open method defined. This causes issues when
used with utf8 or bytes on top of a layer that uses multiple arguments.

For 5.15 I think abolishing this feature may make most sense. It's just
flat out wrong IMO, it's the layer that uses the arguments that should
validate them, not the topmost, which may not even touch them. In the
mean time adding the multiargs flag to :utf8 and :bytes is a reasonable
stop-gap.

This patch makes perl slightly more permissive, so it shouldn't break
any working code out there.
  • Loading branch information
Leont authored and Father Chrysostomos committed Apr 7, 2011
1 parent 4c34a69 commit a778d1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions perlio.c
Expand Up @@ -1963,7 +1963,7 @@ PERLIO_FUNCS_DECL(PerlIO_utf8) = {
sizeof(PerlIO_funcs),
"utf8",
0,
PERLIO_K_DUMMY | PERLIO_K_UTF8,
PERLIO_K_DUMMY | PERLIO_K_UTF8 | PERLIO_K_MULTIARG,
PerlIOUtf8_pushed,
NULL,
PerlIOBase_open,
Expand Down Expand Up @@ -1994,7 +1994,7 @@ PERLIO_FUNCS_DECL(PerlIO_byte) = {
sizeof(PerlIO_funcs),
"bytes",
0,
PERLIO_K_DUMMY,
PERLIO_K_DUMMY | PERLIO_K_MULTIARG,
PerlIOUtf8_pushed,
NULL,
PerlIOBase_open,
Expand Down

0 comments on commit a778d1f

Please sign in to comment.