From ac56653c78029ac04ba470022e46d7169fcefbd7 Mon Sep 17 00:00:00 2001 From: Eugene Crosser Date: Fri, 5 Sep 2008 12:38:04 +0000 Subject: [PATCH] calculate depth against top, not against root (current dir) --- mkgallery.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mkgallery.pl b/mkgallery.pl index f7ef6c3..1031da6 100755 --- a/mkgallery.pl +++ b/mkgallery.pl @@ -117,7 +117,6 @@ sub new { $class = $this; my $root=shift; $self = { - -depth=>0, -root=>$root, -fullpath=>$root, }; @@ -159,6 +158,7 @@ sub initpaths { $pos=index($inc,'/',$pos+1)) { $dp++; } + $self->{-depth} = $dp; for ($pos=length($fullpath);$dp>0 && $pos>0; $pos=rindex($fullpath,'/',$pos-1)) { $dp--; @@ -174,6 +174,7 @@ sub initpaths { $self->{-inc} = 'NO-.INCLUDE-IN-PATH/'; # won't work anyway $self->{-rss} = ''; $self->{-relpath} = ''; + $self->{-depth} = 0; } } -- 2.39.2