diff options
author | mike@exegenix.com <mike@exegenix.com> | 2003-03-24 16:29:08 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-03-26 22:30:09 +0000 |
commit | f21dc558ba1787c481c41d0e2a712ea60b9b1444 (patch) | |
tree | d8e20b7450f27e6166b4c6cda11d9db74c7d739b /ext/IO | |
parent | bc44a8a2ef6444a7379feaa886439b1a4b82d7b2 (diff) | |
download | perl-f21dc558ba1787c481c41d0e2a712ea60b9b1444.tar.gz |
[perl #21672] IO::New and undefined filename behaviour
From: "mike@exegenix.com (via RT)" <perlbug-followup@perl.org>
Message-Id: <rt-21672-54038.2.07650993465862@bugs6.perl.org>
plus a regression test
p4raw-id: //depot/perl@19072
Diffstat (limited to 'ext/IO')
-rw-r--r-- | ext/IO/lib/IO/File.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/IO/lib/IO/File.pm b/ext/IO/lib/IO/File.pm index d5520cbd93..9c4177a6a1 100644 --- a/ext/IO/lib/IO/File.pm +++ b/ext/IO/lib/IO/File.pm @@ -158,9 +158,11 @@ sub open { defined $perms or $perms = 0666; return sysopen($fh, $file, $mode, $perms); } - if (! File::Spec->file_name_is_absolute($file)) { - $file = File::Spec->catfile(File::Spec->curdir(),$file); - } + if (defined($file) && length($file) + && ! File::Spec->file_name_is_absolute($file)) + { + $file = File::Spec->catfile(File::Spec->curdir(),$file); + } $file = IO::Handle::_open_mode_string($mode) . " $file\0"; } open($fh, $file); |