From: Frank Lichtenheld Date: Sun, 17 Jun 2007 08:31:02 +0000 (+0200) Subject: cvsserver: always initialize state in argsplit() X-Git-Tag: v1.5.3-rc1~60 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1e76b702c1e754c7e6df1ced9ce6f1863cb7e092;p=git.git cvsserver: always initialize state in argsplit() Other code assumes that this is initialized, so do it even if there were no arguments given. Signed-off-by: Dirk Koopman Signed-off-by: Frank Lichtenheld Signed-off-by: Junio C Hamano --- diff --git a/git-cvsserver.perl b/git-cvsserver.perl index 5cbf27eeb..10aba507d 100755 --- a/git-cvsserver.perl +++ b/git-cvsserver.perl @@ -1813,14 +1813,14 @@ sub req_annotate # the second is $state->{files} which is everything after it. sub argsplit { - return unless( defined($state->{arguments}) and ref $state->{arguments} eq "ARRAY" ); - - my $type = shift; - $state->{args} = []; $state->{files} = []; $state->{opt} = {}; + return unless( defined($state->{arguments}) and ref $state->{arguments} eq "ARRAY" ); + + my $type = shift; + if ( defined($type) ) { my $opt = {};