+
+ if (@dirstack && defined ($dist_dir)
+ && (my ($match, $file, $line) = /^(([^\s:]+):(\d+):)/)) {
+ $file = File::Spec->rel2abs ($file, $dirstack[$#dirstack]);
+ my (@path) = grep ($_ ne '' && $_ ne '.', split ('/', $file));
+ for (my $i = 1; $i <= $#path; ) {
+ if ($path[$i] eq '..') {
+ splice (@path, $i - 1, 2);
+ $i-- if $i > 1;
+ } else {
+ $i++;
+ }
+ }
+
+ for (my $i = $#path; $i >= 0; $i--) {
+ if ($path[$i] eq $dist_dir) {
+ my $dist_file = join ('/', @path[$i..$#path]);
+ if (exists ($dist_files{$dist_file})) {
+ $d{MATCH} = length ($match);
+ $d{LINE} = $line;
+ $d{FILE} = $dist_file;
+ }
+ last;
+ }
+ }
+ }