summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorYaroslav Kuzmin <ykuzmin@rocketsoftware.com>2016-09-02 14:27:21 -0600
committerKarl Williamson <khw@cpan.org>2016-09-08 09:00:12 -0600
commit49fc490652d8b428d67872fae3acb10f0b43cff7 (patch)
treee46265b5080893040eafe894b6ca98bc48daf328 /perlio.c
parent25cf9644e6dfb6b7cb9e767b3f52baa4b81a7df0 (diff)
downloadperl-49fc490652d8b428d67872fae3acb10f0b43cff7.tar.gz
perlio.c: Fix z/OS problem
See thread starting at <6E741FE88A7C4E428528A0AAAB94D735B65C65@DFLE10.ent.ti.com> (The commiter made some white space changes to the patch)
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/perlio.c b/perlio.c
index e60f3bb9ca..d56dc9a32b 100644
--- a/perlio.c
+++ b/perlio.c
@@ -1987,6 +1987,37 @@ PerlIOBase_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
SETERRNO(EINVAL, LIB_INVARG);
return -1;
}
+#ifdef EBCDIC
+ {
+ /* The mode variable contains one positional parameter followed by
+ * optional keyword parameters. The positional parameters must be
+ * passed as lowercase characters. The keyword parameters can be
+ * passed in mixed case. They must be separated by commas. Only one
+ * instance of a keyword can be specified. */
+ int comma = 0;
+ while (*mode) {
+ switch (*mode++) {
+ case '+':
+ if(!comma)
+ l->flags |= PERLIO_F_CANREAD | PERLIO_F_CANWRITE;
+ break;
+ case 'b':
+ if(!comma)
+ l->flags &= ~PERLIO_F_CRLF;
+ break;
+ case 't':
+ if(!comma)
+ l->flags |= PERLIO_F_CRLF;
+ break;
+ case ',':
+ comma = 1;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+#else
while (*mode) {
switch (*mode++) {
case '+':
@@ -2003,6 +2034,7 @@ PerlIOBase_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab)
return -1;
}
}
+#endif
}
else {
if (l->next) {