Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't push a directory named '0' #15

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tidy code
djerius committed Jan 22, 2019
commit 309baf66cb9a0334f9427dac3b9315ab9856fae1
14 changes: 7 additions & 7 deletions lib/File/pushd.pm
Original file line number Diff line number Diff line change
@@ -26,9 +26,9 @@ use overload

sub pushd {
# Called in void context?
unless (defined wantarray) {
warnings::warnif(void => 'Useless use of File::pushd::pushd in void context');
return
unless ( defined wantarray ) {
warnings::warnif( void => 'Useless use of File::pushd::pushd in void context' );
return;
}

my ( $target_dir, $options ) = @_;
@@ -77,9 +77,9 @@ sub pushd {

sub tempd {
# Called in void context?
unless (defined wantarray) {
warnings::warnif(void => 'Useless use of File::pushd::tempd in void context');
return
unless ( defined wantarray ) {
warnings::warnif( void => 'Useless use of File::pushd::tempd in void context' );
return;
}

my ($options) = @_;
@@ -116,7 +116,7 @@ sub DESTROY {
my ($self) = @_;
my $orig = $self->{_original};
chdir $orig if $orig; # should always be so, but just in case...
if ( $self->{_tempd}
if ( $self->{_tempd}
&& $self->{_owner} == $$
&& !$self->{_preserve} )
{
6 changes: 3 additions & 3 deletions t/File_pushd.t
Original file line number Diff line number Diff line change
@@ -230,11 +230,11 @@ ok( -e $expected_dir, "original directory not removed" );
# Test removing temp directory by owner process
#--------------------------------------------------------------------------#
if ( $Config{d_fork} ) {
my $new_dir = tempd();
my $new_dir = tempd();
my $temp_dir = "$new_dir";
my $pid = fork;
my $pid = fork;
die "Can't fork: $!" unless defined $pid;
if ($pid == 0) {
if ( $pid == 0 ) {
exit;
}
wait;