From 0592daf3efb2e6df897ade2b5e61390b2a37157a Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Thu, 17 Nov 2011 20:09:42 +0000 Subject: [PATCH] Add comments justifying is_a_node($target) check in unstow_contents(). --- stow.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stow.in b/stow.in index d643787..a3a4956 100755 --- a/stow.in +++ b/stow.in @@ -661,10 +661,13 @@ sub unstow_contents { my $cwd = getcwd(); debug(2, "Unstowing from $target (cwd is $cwd)"); debug(3, "--- source path is $path"); - # We traverse the source tree not the target tree, + # We traverse the source tree not the target tree, so $path must exist. error("unstow_contents() called with non-directory path: $path") unless -d $path; - error("unstow_contents() called with non-directory target: $target") + # When called at the top level, $target should exist. And + # unstow_node() should only call this via mutual recursion if + # $target exists. + error("unstow_contents() called with invalid target: $target") unless is_a_node($target); opendir my $DIR, $path