Subject: [PATCH 2/5] cvsserver: Handle three part keys in git config correctly

From: Frank Lichtenheld <[email-masked]>
Date: Mon, 19 Mar 2007 16:55:58 +0100

This is intended to be used in the form gitcvs.<method>.<var>
but this patch doesn't introduce any users yet.

Signed-off-by: Frank Lichtenheld <[email-masked]>
---
 git-cvsserver.perl |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index e9d489b..4edb796 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -183,8 +183,12 @@ sub req_Root
     }
     foreach my $line ( @gitvars )
     {
-        next unless ( $line =~ /^(.*?)\.(.*?)=(.*)$/ );
-        $cfg->{$1}{$2} = $3;
+        next unless ( $line =~ /^(.*?)\.(.*?)(?:\.(.*?))?=(.*)$/ );
+        unless ($3) {
+            $cfg->{$1}{$2} = $4;
+        } else {
+            $cfg->{$1}{$2}{$3} = $4;
+        }
     }
 
     unless ( defined ( $cfg->{gitcvs}{enabled} ) and $cfg->{gitcvs}{enabled} =~ /^\s*(1|true|yes)\s*$/i )
-- 
1.5.0.3