calculate depth against top, not against root (current dir)
authorEugene Crosser <crosser@average.org>
Fri, 5 Sep 2008 12:38:04 +0000 (12:38 +0000)
committerEugene Crosser <crosser@average.org>
Fri, 5 Sep 2008 12:38:04 +0000 (12:38 +0000)
mkgallery.pl

index f7ef6c3e7ef4ff41411a9b379e9b42e4e8269310..1031da6949dfab9397931ccfc0adfa993dfa33b5 100755 (executable)
@@ -117,7 +117,6 @@ sub new {
                $class = $this;
                my $root=shift;
                $self = {
                $class = $this;
                my $root=shift;
                $self = {
-                               -depth=>0,
                                -root=>$root,
                                -fullpath=>$root,
                        };
                                -root=>$root,
                                -fullpath=>$root,
                        };
@@ -159,6 +158,7 @@ sub initpaths {
                                        $pos=index($inc,'/',$pos+1)) {
                        $dp++;
                }
                                        $pos=index($inc,'/',$pos+1)) {
                        $dp++;
                }
+               $self->{-depth} = $dp;
                for ($pos=length($fullpath);$dp>0 && $pos>0;
                                        $pos=rindex($fullpath,'/',$pos-1)) {
                        $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->{-inc} = 'NO-.INCLUDE-IN-PATH/'; # won't work anyway
                $self->{-rss} = '';
                $self->{-relpath} = '';
+               $self->{-depth} = 0;
        }
 }
 
        }
 }