summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>2001-07-02 02:21:17 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2001-07-02 13:20:50 +0000
commitf5f423e4590905c45492eda1312cb2f76a6ef9a7 (patch)
treeaec1cc8091d7e99e87e0c2658004bc2a891b9327 /lib
parent6fbe8946df869c4ec4c3a3638877b93445042402 (diff)
downloadperl-f5f423e4590905c45492eda1312cb2f76a6ef9a7.tar.gz
OS/2 cwd
Message-ID: <20010702062117.A1401@math.ohio-state.edu> p4raw-id: //depot/perl@11084
Diffstat (limited to 'lib')
-rw-r--r--lib/Cwd.pm19
-rw-r--r--lib/File/Find/taint.t2
-rw-r--r--lib/FindBin.pm6
3 files changed, 23 insertions, 4 deletions
diff --git a/lib/Cwd.pm b/lib/Cwd.pm
index 27a3105f3b..632931b133 100644
--- a/lib/Cwd.pm
+++ b/lib/Cwd.pm
@@ -85,6 +85,25 @@ use base qw/ Exporter /;
our @EXPORT = qw(cwd getcwd fastcwd fastgetcwd);
our @EXPORT_OK = qw(chdir abs_path fast_abs_path realpath fast_realpath);
+# sys_cwd may keep the builtin command
+
+# All the functionality of this module may provided by builtins,
+# there is no sense to process the rest of the file.
+# The best choice may be to have this in BEGIN, but how to return from BEGIN?
+
+if ($^O eq 'os2' && defined &sys_cwd && defined &sys_abspath) {
+ local $^W = 0;
+ *cwd = \&sys_cwd;
+ *getcwd = \&cwd;
+ *fastgetcwd = \&cwd;
+ *fastcwd = \&cwd;
+ *abs_path = \&sys_abspath;
+ *fast_abs_path = \&abs_path;
+ *realpath = \&abs_path;
+ *fast_realpath = \&abs_path;
+ return 1;
+}
+
eval {
require XSLoader;
XSLoader::load('Cwd');
diff --git a/lib/File/Find/taint.t b/lib/File/Find/taint.t
index f640ef710c..e4a292be14 100644
--- a/lib/File/Find/taint.t
+++ b/lib/File/Find/taint.t
@@ -44,7 +44,7 @@ use File::Spec;
use Cwd;
-my $NonTaintedCwd = $^O eq 'MSWin32' || $^O eq 'cygwin';
+my $NonTaintedCwd = $^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'os2';
cleanup();
diff --git a/lib/FindBin.pm b/lib/FindBin.pm
index 5d4c575cbc..91958a8050 100644
--- a/lib/FindBin.pm
+++ b/lib/FindBin.pm
@@ -107,15 +107,15 @@ BEGIN
}
else
{
- my $IsWin32 = $^O eq 'MSWin32';
- unless(($script =~ m#/# || ($IsWin32 && $script =~ m#\\#))
+ my $doshish = ($^O eq 'MSWin32' or $^O eq 'os2');
+ unless(($script =~ m#/# || ($dosish && $script =~ m#\\#))
&& -f $script)
{
my $dir;
foreach $dir (File::Spec->path)
{
my $scr = File::Spec->catfile($dir, $script);
- if(-r $scr && (!$IsWin32 || -x _))
+ if(-r $scr && (!$dosish || -x _))
{
$script = $scr;