Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IO::File $fh->binmode($layer) is broken #7965

Closed
p5pRT opened this issue Jun 10, 2005 · 4 comments
Closed

IO::File $fh->binmode($layer) is broken #7965

p5pRT opened this issue Jun 10, 2005 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 10, 2005

Migrated from rt.perl.org#36237 (status was 'resolved')

Searchable as RT36237$

@p5pRT
Copy link
Author

p5pRT commented Jun 10, 2005

From alexander_foken@de.rolandberger.com

Created by alexander-foken@de.rolandberger.com

IO​::File​::binmode() fails to set any PerlIO layer, because it tests @​_
for 0 or 1 elements, but it is called as object method having always at
least one element in @​_. With a LAYER argument, @​_ has two elements and
IO​::File​::binmode() croak()s.

Trivial patch​:

Inline Patch
--- IO/File.pm-buggy    Mon Jun 06 13:29:48 2005
+++ IO/File.pm    Fri Jun 10 14:26:35 2005
@@ -197,7 +197,7 @@
 ##
 
 sub binmode {
-    ( @_ == 0 or @_ == 1 ) or croak 'usage $fh->binmode([LAYER])';
+    ( @_ == 1 or @_ == 2 ) or croak 'usage $fh->binmode([LAYER])';
 
     my($fh, $layer) = @_;
Perl Info

Flags:
    category=library
    severity=low

Site configuration information for perl v5.8.7:

Configured by afoken at Mon Jun  6 13:30:23 2005.

Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
  Platform:
    osname=MSWin32, osvers=5.0, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=define use5005threads=undef useithreads=define 
usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cl', ccflags ='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 
-D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT 
-DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX',
    optimize='-MD -Zi -DNDEBUG -O1',
    cppflags='-DWIN32'
    ccversion='12.00.8804', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', 
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf  
-libpath:"c:\perl\lib\CORE"  -machine:x86'
    libpth=\lib
    libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib  version.lib 
odbc32.lib odbccp32.lib msvcrt.lib
    perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib 
winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib 
oleaut32.lib  netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib  
version.lib odbc32.lib odbccp32.lib msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
    gnulibc_version='undef'
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug 
-opt:ref,icf  -libpath:"c:\perl\lib\CORE"  -machine:x86'

Locally applied patches:
   


@INC for perl v5.8.7:
    c:/perl/lib
    c:/perl/site/lib
    .


Environment for perl v5.8.7:
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=C:\oracle\ora81\bin;C:\Program 
Files\Oracle\jre\1.1.7\bin;d:\bin;c:\perl\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program 
Files\UltraEdit;C:\VS6\Common\Tools\WinNT;C:\VS6\Common\MSDev98\Bin;C:\VS6\Common\Tools;C:\VS6\VC98\bin
    PERL_BADLANG (unset)
    SHELL (unset)

-- 

________________________________________
| *Alexander Foken*
| IT Consultant

| *Roland Berger Strategy Consultants*
| .bits business intelligence and technology services
| http://www.rolandberger.com

| Stadthausbrücke 7 | 20355 Hamburg | Germany
| Phone +49 40 3 76 31 351 | Fax +49 40 3 76 31 102
| mailto:Alexander_Foken@de.rolandberger.com 
 
Please inform us immediately if this e-mail and/or any attachment was 
transmitted incompletely or was not intelligible.
___________________________________________________________________________
 
This e-mail and any attachment is for authorized use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by any other party. 
If you are not an intended recipient then please promptly delete this 
e-mail and any attachment and all copies and inform the sender. 

@p5pRT
Copy link
Author

p5pRT commented Jun 16, 2005

From @rgs

Alexander Foken wrote​:

IO​::File​::binmode() fails to set any PerlIO layer, because it tests @​_
for 0 or 1 elements, but it is called as object method having always at
least one element in @​_. With a LAYER argument, @​_ has two elements and
IO​::File​::binmode() croak()s.

Trivial patch​:

Thanks, applied as change #24869 to the development version of perl.

--- IO/File.pm-buggy Mon Jun 06 13​:29​:48 2005
+++ IO/File.pm Fri Jun 10 14​:26​:35 2005
@​@​ -197,7 +197,7 @​@​
##

sub binmode {
- ( @​_ == 0 or @​_ == 1 ) or croak 'usage $fh->binmode([LAYER])';
+ ( @​_ == 1 or @​_ == 2 ) or croak 'usage $fh->binmode([LAYER])';

@p5pRT
Copy link
Author

p5pRT commented Jun 16, 2005

The RT System itself - Status changed from 'new' to 'open'

@p5pRT p5pRT closed this as completed Jun 16, 2005
@p5pRT
Copy link
Author

p5pRT commented Jun 16, 2005

@rgs - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant