From c7f6af4af5e052d7357752d85eb4bdb097c27634 Mon Sep 17 00:00:00 2001 From: freesource Date: Fri, 30 Nov 2001 03:35:02 +0000 Subject: [PATCH] This takes care of a problem when links were specified which didn't actually exist, or had no / appended .. basically dirname turned into "." which created a directory apart from the loopback dir. Fixed in make_link_absolute. --- BootRoot/Yard.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/BootRoot/Yard.pm b/BootRoot/Yard.pm index 8496571..8b495ba 100644 --- a/BootRoot/Yard.pm +++ b/BootRoot/Yard.pm @@ -403,7 +403,7 @@ sub read_contents_file { } else { info(0, "Using Replacement $replacement because it was" . - "found in an absolute location\n"); + " found in an absolute location\n"); $abs_replacement = $replacement; $replaced_by{$file} = $abs_replacement; $Included{$file} = 1; @@ -1721,11 +1721,18 @@ sub find_file_in_path { sub make_link_absolute { my($file, $target) = @_; + my $link; + if ($target =~ m|^/|) { $target; # Target is absolute, just return it } else { - cleanup_link(dirname($file) . "/$target"); + $link =cleanup_link(dirname($file) . "/$target"); } + + $link =~ s,^\.,,; # When there is one file dir eq . --freesource + + return $link; + }