summaryrefslogtreecommitdiff
path: root/lib/Cwd.pm
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-03-01 17:32:09 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-03-01 17:32:09 +0000
commit392d8ab87e777b9cbe24017195a858306294969b (patch)
treec89bc09c6f7b0c3cd18f719920cd2a617b19fa91 /lib/Cwd.pm
parent2675e62cfb03bffd85b62ed4fc8aad4f11a85e0a (diff)
downloadperl-392d8ab87e777b9cbe24017195a858306294969b.tar.gz
yet more multiline match cleanups (from Greg Bacon)
p4raw-id: //depot/perl@5406
Diffstat (limited to 'lib/Cwd.pm')
-rw-r--r--lib/Cwd.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Cwd.pm b/lib/Cwd.pm
index e3c45903c3..5ddbbbed67 100644
--- a/lib/Cwd.pm
+++ b/lib/Cwd.pm
@@ -142,7 +142,7 @@ sub fastcwd {
if ($^O eq 'apollo') { $path = "/".$path; }
# At this point $path may be tainted (if tainting) and chdir would fail.
# To be more useful we untaint it then check that we landed where we started.
- $path = $1 if $path =~ /^(.*)$/; # untaint
+ $path = $1 if $path =~ /^(.*)\z/s; # untaint
CORE::chdir($path) || return undef;
($cdev, $cino) = stat('.');
die "Unstable directory path, current directory changed unexpectedly"
@@ -170,7 +170,7 @@ sub chdir_init {
$ENV{'PWD'} = cwd();
}
# Strip an automounter prefix (where /tmp_mnt/foo/bar == /foo/bar)
- if ($ENV{'PWD'} =~ m|(/[^/]+(/[^/]+/[^/]+))(.*)|) {
+ if ($ENV{'PWD'} =~ m|(/[^/]+(/[^/]+/[^/]+))(.*)|s) {
my($pd,$pi) = stat($2);
my($dd,$di) = stat($1);
if (defined $pd and defined $dd and $di == $pi and $dd == $pd) {
@@ -187,7 +187,7 @@ sub chdir {
return 0 unless CORE::chdir $newdir;
if ($^O eq 'VMS') { return $ENV{'PWD'} = $ENV{'DEFAULT'} }
- if ($newdir =~ m#^/#) {
+ if ($newdir =~ m#^/#s) {
$ENV{'PWD'} = $newdir;
} else {
my @curdir = split(m#/#,$ENV{'PWD'});