diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-06-16 16:44:35 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-06-16 16:44:35 +0000 |
commit | 0c4128adc5f62cd332ae4fa5bc8999c95d611d36 (patch) | |
tree | 2c4ca39286eac5fc29c855dc710afb446b4800b1 /perlio.c | |
parent | a8c08ecdc5ffec9869657a967edfe7b74a713a27 (diff) | |
download | perl-0c4128adc5f62cd332ae4fa5bc8999c95d611d36.tar.gz |
Work-in-progress win32 layer semi-functional, checking
for UNIX breakage.
p4raw-id: //depot/perlio@10632
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -764,10 +764,16 @@ PerlIO_default_layers(pTHX) if (!PerlIO_def_layerlist) { const char *s = (PL_tainting) ? Nullch : PerlEnv_getenv("PERLIO"); - PerlIO_def_layerlist = PerlIO_list_alloc(); - - PerlIO_define_layer(aTHX_ &PerlIO_raw); + PerlIO_funcs *osLayer = &PerlIO_unix; + PerlIO_def_layerlist = PerlIO_list_alloc(); +#ifdef WIN32 + osLayer = &PerlIO_win32; PerlIO_define_layer(aTHX_ &PerlIO_unix); +#else + osLayer = &PerlIO_unix; +#endif + PerlIO_define_layer(aTHX_ osLayer); + PerlIO_define_layer(aTHX_ &PerlIO_raw); PerlIO_define_layer(aTHX_ &PerlIO_perlio); PerlIO_define_layer(aTHX_ &PerlIO_stdio); PerlIO_define_layer(aTHX_ &PerlIO_crlf); @@ -776,7 +782,7 @@ PerlIO_default_layers(pTHX) #endif PerlIO_define_layer(aTHX_ &PerlIO_utf8); PerlIO_define_layer(aTHX_ &PerlIO_byte); - PerlIO_list_push(PerlIO_def_layerlist,PerlIO_find_layer(aTHX_ PerlIO_unix.name,0,0),&PL_sv_undef); + PerlIO_list_push(PerlIO_def_layerlist,PerlIO_find_layer(aTHX_ osLayer->name,0,0),&PL_sv_undef); if (s) { PerlIO_parse_layers(aTHX_ PerlIO_def_layerlist,s); @@ -1887,6 +1893,8 @@ int PerlIOUnix_oflags(const char *mode) { int oflags = -1; + if (*mode == 'I' || *mode == '#') + mode++; switch(*mode) { case 'r': @@ -2617,7 +2625,7 @@ PerlIOBuf_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char if (*mode == 'I') { init = 1; - mode++; + /* mode++; */ } f = (*tab->Open)(aTHX_ tab, layers, n-1, mode,fd,imode,perm,NULL,narg,args); if (f) |