summaryrefslogtreecommitdiff
path: root/ext/IO
diff options
context:
space:
mode:
authorPeter Prymmer <PPrymmer@factset.com>1999-06-11 10:07:19 -0700
committerGurusamy Sarathy <gsar@cpan.org>1999-07-06 09:51:20 +0000
commitc70704064b4c55c8116e7b43f88c86dc34819ee2 (patch)
tree7e3cf7f38d51f0ea19652359af0a8ec47e6ca448 /ext/IO
parentaf7d13df55983dddc63f9a0d17150fe82dfa08fb (diff)
downloadperl-c70704064b4c55c8116e7b43f88c86dc34819ee2.tar.gz
portability fix for IO::File and FileHandle
Message-Id: <9906120007.AA13802@forte.com> p4raw-id: //depot/perl@3611
Diffstat (limited to 'ext/IO')
-rw-r--r--ext/IO/lib/IO/File.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/IO/lib/IO/File.pm b/ext/IO/lib/IO/File.pm
index fa7e804351..47f43d1292 100644
--- a/ext/IO/lib/IO/File.pm
+++ b/ext/IO/lib/IO/File.pm
@@ -110,6 +110,7 @@ use Carp;
use Symbol;
use SelectSaver;
use IO::Seekable;
+use File::Spec;
require Exporter;
require DynaLoader;
@@ -158,7 +159,9 @@ sub open {
defined $perms or $perms = 0666;
return sysopen($fh, $file, $mode, $perms);
}
- $file = './' . $file if $file =~ m{\A[^\\/\w]};
+ if (! 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);