From a778d1f5c1a446254887ec8addb0044ba74ea05a Mon Sep 17 00:00:00 2001 From: Leon Timmermans Date: Thu, 7 Apr 2011 12:33:21 +0200 Subject: [PATCH] Make :utf8 and :bytes MULTIARG 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. --- perlio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perlio.c b/perlio.c index f2f872956767..e42a78fc286a 100644 --- a/perlio.c +++ b/perlio.c @@ -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, @@ -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,