From: Wolfgang Laun Date: Mon, 28 Aug 2000 13:08:30 +0000 (+0200) Subject: [ID 20000828.006] dir name "0" not safe with Cwd.pm X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3c65c14be7caf9d59f60265b97510dd50142dc82;p=p5sagit%2Fp5-mst-13.2.git [ID 20000828.006] dir name "0" not safe with Cwd.pm Message-Id: <200008281108.NAA00782@localhost.aut.alcatel.at> p4raw-id: //depot/perl@6858 --- diff --git a/lib/Cwd.pm b/lib/Cwd.pm index 1e544d98..eb337b4 100644 --- a/lib/Cwd.pm +++ b/lib/Cwd.pm @@ -180,7 +180,7 @@ sub chdir_init { } sub chdir { - my $newdir = shift || ''; # allow for no arg (chdir to HOME dir) + my $newdir = @? ? shift : ''; # allow for no arg (chdir to HOME dir) $newdir =~ s|///*|/|g unless $^O eq 'MSWin32'; chdir_init() unless $chdir_init; return 0 unless CORE::chdir $newdir; @@ -271,7 +271,7 @@ sub abs_path sub fast_abs_path { my $cwd = getcwd(); - my $path = shift || '.'; + my $path = @_ ? shift : '.'; CORE::chdir($path) || croak "Cannot chdir to $path:$!"; my $realpath = getcwd(); CORE::chdir($cwd) || croak "Cannot chdir back to $cwd:$!"; @@ -340,7 +340,7 @@ sub _qnx_cwd { } sub _qnx_abs_path { - my $path = shift || '.'; + my $path = @_ ? shift '.'; my $realpath=`/usr/bin/fullpath -t $path`; chop $realpath; return $realpath;