cvs-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl


From: Derek Robert Price
Subject: [Cvs-cvs] ccvs/contrib ChangeLog log_accum.pl
Date: Thu, 03 Aug 2006 17:31:44 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Changes by:     Derek Robert Price <dprice>     06/08/03 17:31:44

Modified files:
        contrib        : ChangeLog log_accum.pl 

Log message:
        * log_accum.pl (get_topdir): Don't assume the directory list will be
        ordered by increasing path length.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/contrib/ChangeLog?cvsroot=cvs&r1=1.212&r2=1.213
http://cvs.savannah.gnu.org/viewcvs/ccvs/contrib/log_accum.pl?cvsroot=cvs&r1=1.48&r2=1.49

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/contrib/ChangeLog,v
retrieving revision 1.212
retrieving revision 1.213
diff -u -b -r1.212 -r1.213
--- ChangeLog   3 Aug 2006 16:37:59 -0000       1.212
+++ ChangeLog   3 Aug 2006 17:31:44 -0000       1.213
@@ -1,5 +1,8 @@
 2006-08-03  Derek Price  <address@hidden>
 
+       * log_accum.pl (get_topdir): Don't assume the directory list will be
+       ordered by increasing path length.
+
        * log_accum.pl (debug): New function.
        (option_spec): Parse debug log names.
        (set_defaults): Open debug log files.

Index: log_accum.pl
===================================================================
RCS file: /cvsroot/cvs/ccvs/contrib/log_accum.pl,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- log_accum.pl        3 Aug 2006 16:37:59 -0000       1.48
+++ log_accum.pl        3 Aug 2006 17:31:44 -0000       1.49
@@ -868,14 +868,19 @@
     # Find the highest common directory.
     my @dirs = grep m#/$#, @list;
     map s#/$##, @dirs;
+    # The first dir in the list may be the top.
     my @topsplit = split m#/#, $dirs[0];
-    for (my $i = 1; $i <= $#dirs; $i++)
+    for (my $i = 1; $i < @dirs; $i++)
     {
        my @dirsplit = split m#/#, $dirs[$i];
-       for (my $j = 0; $j <= $#topsplit and $j <= $#dirsplit; $j++)
+       # If the current dir has fewer elements than @topsplit, later elements
+       # in @topsplit are obviously not part of the topdir specification.
+       splice @topsplit, @dirsplit if @dirsplit < @topsplit;
+       for (my $j = 0; $j < @topsplit; $j++)
        {
            if ($topsplit[$j] ne $dirsplit[$j])
            {
+               # Elements at index $j and later do not specify the same dir.
                splice @topsplit, $j;
                last;
            }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]