Ignore:
Timestamp:
02/07/10 11:19:10 (2 years ago)
Author:
kthakore
Message:

Add a fix for ticket #845. The problem was that when padre is called like so 'padre somedir/file.pl'. The resulting Document object had filename = somedir/file.pl and projectdir = somdir. So when we try to run the code the command created chdir in get_command once to projectdir and then tries to run somedir/file.pl. So it crashes by try to chdir twice in somedir then run file. To fix this I made it check before chdir to see if the somedir exists. Then I also see if Document->{filename} has a \|\/\ in it and if it does split and take the last element.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/lib/Padre/Document/Perl.pm

    r10543 r10606  
    319319    my $dir = File::Basename::dirname($filename); 
    320320    chdir $dir; 
     321     
     322    # (Ticket #845) if Padre folder/script.pl is called filename has folder/ in it so we check for that 
     323 
     324    if( $filename =~ /\\|\//) 
     325    { 
     326    my @file_name = split /\\|\//, $filename; 
     327    $filename = $file_name[$#file_name]; 
     328    } 
     329 
     330 
     331 
    321332    return $debug 
    322333        ? qq{"$perl" -Mdiagnostics(-traceonly) $run_args{interpreter} "$filename"$Script_Args} 
Note: See TracChangeset for help on using the changeset viewer.