From: Peter Prymmer Date: Fri, 11 Jun 1999 17:07:19 +0000 (-0700) Subject: portability fix for IO::File and FileHandle X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c70704064b4c55c8116e7b43f88c86dc34819ee2;p=p5sagit%2Fp5-mst-13.2.git portability fix for IO::File and FileHandle Message-Id: <9906120007.AA13802@forte.com> p4raw-id: //depot/perl@3611 --- diff --git a/ext/IO/lib/IO/File.pm b/ext/IO/lib/IO/File.pm index fa7e804..47f43d1 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);