mirror of
https://github.com/fspc/gbootroot.git
synced 2025-02-23 09:03:23 -05:00
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.
This commit is contained in:
parent
9d2ffa3a89
commit
c7f6af4af5
@ -403,7 +403,7 @@ sub read_contents_file {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
info(0, "Using Replacement $replacement because it was" .
|
info(0, "Using Replacement $replacement because it was" .
|
||||||
"found in an absolute location\n");
|
" found in an absolute location\n");
|
||||||
$abs_replacement = $replacement;
|
$abs_replacement = $replacement;
|
||||||
$replaced_by{$file} = $abs_replacement;
|
$replaced_by{$file} = $abs_replacement;
|
||||||
$Included{$file} = 1;
|
$Included{$file} = 1;
|
||||||
@ -1721,11 +1721,18 @@ sub find_file_in_path {
|
|||||||
sub make_link_absolute {
|
sub make_link_absolute {
|
||||||
my($file, $target) = @_;
|
my($file, $target) = @_;
|
||||||
|
|
||||||
|
my $link;
|
||||||
|
|
||||||
if ($target =~ m|^/|) {
|
if ($target =~ m|^/|) {
|
||||||
$target; # Target is absolute, just return it
|
$target; # Target is absolute, just return it
|
||||||
} else {
|
} else {
|
||||||
cleanup_link(dirname($file) . "/$target");
|
$link =cleanup_link(dirname($file) . "/$target");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$link =~ s,^\.,,; # When there is one file dir eq . --freesource
|
||||||
|
|
||||||
|
return $link;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user