Skip to content

Commit

Permalink
Check that find_stowed_path $path matches relative/absolute with target
Browse files Browse the repository at this point in the history
Watch out for a corner case probably only relevant in tests.
  • Loading branch information
aspiers committed Jun 28, 2019
1 parent 3270b14 commit 40a0807
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Stow.pm.in
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,12 @@ sub find_stowed_path {
# If no .stow file was found, we need to find out whether it's
# owned by the current stow directory, in which case $path will be
# a prefix of $self->{stow_path}.
if (substr($path, 0, 1) eq '/' xor substr($self->{stow_path}, 0, 1) eq '/')
{
warn "BUG in find_stowed_path? Absolute/relative mismatch between " .
"Stow dir $self->{stow_path} and path $path";
}

my @stow_path = split m{/+}, $self->{stow_path};

# Strip off common prefixes until one is empty
Expand Down

0 comments on commit 40a0807

Please sign in to comment.