summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 198a2a8)
raw | patch | inline | side by side (parent: 198a2a8)
author | Frank Lichtenheld <frank@lichtenheld.de> | |
Sun, 13 May 2007 00:16:24 +0000 (02:16 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 13 May 2007 19:14:22 +0000 (12:14 -0700) |
Change the configuration parser so that it ignores
everything except for ^gitcvs.((ext|pserver).)?
This greatly reduces the risk of failing while
parsing some unknown and irrelevant config option.
The bug that triggered this change was that the
parsing doesn't handle sections that have a
subsection and a variable with the same name.
While this bug still remains, all remaining
causes can be attributed to user error, since
there are no defined variables gitcvs.ext and
gitcvs.pserver.
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
everything except for ^gitcvs.((ext|pserver).)?
This greatly reduces the risk of failing while
parsing some unknown and irrelevant config option.
The bug that triggered this change was that the
parsing doesn't handle sections that have a
subsection and a variable with the same name.
While this bug still remains, all remaining
causes can be attributed to user error, since
there are no defined variables gitcvs.ext and
gitcvs.pserver.
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-cvsserver.perl | patch | blob | history |
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 3e7bf5b54afc1c9176406fc98d9e5b333d10f6aa..a07c72526f4b2ad54a03ac3d1f7e59670150c0d0 100755 (executable)
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
}
foreach my $line ( @gitvars )
{
- next unless ( $line =~ /^(.*?)\.(.*?)(?:\.(.*?))?=(.*)$/ );
- unless ($3) {
- $cfg->{$1}{$2} = $4;
+ next unless ( $line =~ /^(gitcvs)\.(?:(ext|pserver)\.)?([\w-]+)=(.*)$/ );
+ unless ($2) {
+ $cfg->{$1}{$3} = $4;
} else {
$cfg->{$1}{$2}{$3} = $4;
}