Index: ossp-pkg/cvsfusion/RCS.pm RCS File: /v/ossp/cvs/ossp-pkg/cvsfusion/RCS.pm,v rcsdiff -q -kk '-r1.4' '-r1.5' -u '/v/ossp/cvs/ossp-pkg/cvsfusion/RCS.pm,v' 2>/dev/null --- RCS.pm 2004/04/23 13:09:50 1.4 +++ RCS.pm 2004/04/23 14:57:09 1.5 @@ -156,8 +156,8 @@ my $re_idchar = qr/[^$,.:;@]/; my $re_id = qr/(?:${re_num})?${re_idchar}+(?:${re_idchar}|${re_num})*/; my $re_sym = qr/\d?${re_idchar}+(?:${re_idchar}|\d)*/; - my $re_str = qr/(?:@@|[^@])*/; - my $re_date = qr/\d{4}\.\d{2}\.\d{2}\.\d{2}\.\d{2}\.\d{2}/; + my $re_str = qr/(?:\@\@|[^@])*/s; + my $re_date = qr/(?:\d{2}|\d{4})\.\d{2}\.\d{2}\.\d{2}\.\d{2}\.\d{2}/; # parse header section while (1) { @@ -196,15 +196,23 @@ $self->{'rcs'}->{'header'}->{'strict'} = ""; push(@{$self->{'rcs'}->{'header'}->{-order}}, 'strict'); } - elsif ($rcs =~ s/^comment\s+\@($re_str)\@\s*;//s) { - $self->{'rcs'}->{'header'}->{'comment'} = &_string_unquote($1); + #elsif ($rcs =~ s/^comment\s+\@($re_str)\@\s*;//s) { # would maximally span 32K + elsif ($rcs =~ s/^comment\s+\@//s) { + my $str = ''; + 1 while ($rcs =~ s/^((?:\@\@|[^@])+)/$str .= $1, ''/se); + $rcs =~ s/\@\s*;//s; + $self->{'rcs'}->{'header'}->{'comment'} = &_string_unquote($str); push(@{$self->{'rcs'}->{'header'}->{-order}}, 'comment'); } - elsif ($rcs =~ s/^expand\s+\@($re_str)\@\s*;//s) { - $self->{'rcs'}->{'header'}->{'expand'} = &_string_unquote($1); + #elsif ($rcs =~ s/^expand\s+\@($re_str)\@\s*;//s) { # would maximally span 32K + elsif ($rcs =~ s/^expand\s+\@//s) { + my $str = ''; + 1 while ($rcs =~ s/^((?:\@\@|[^@])+)/$str .= $1, ''/se); + $rcs =~ s/\@\s*;//s; + $self->{'rcs'}->{'header'}->{'expand'} = &_string_unquote($str); push(@{$self->{'rcs'}->{'header'}->{-order}}, 'expand'); } - elsif ($rcs =~ s/^([a-z]+)(\s*[^;]*);//s) { + elsif ($rcs =~ s/^([a-z]+)(?:\s*([^;]*));//s) { $self->{'rcs'}->{'header'}->{$1} = $2; push(@{$self->{'rcs'}->{'header'}->{-order}}, $1); } @@ -240,7 +248,7 @@ elsif ($rcs =~ m/^desc\s+/s) { last; } - elsif ($rcs =~ s/^([a-z]+)(\s*[^;]*);//s) { + elsif ($rcs =~ s/^([a-z]+)(?:\s*([^;]*));//s) { $self->{'rcs'}->{'delta'}->{$rev}->{$1} = $2; } else { @@ -255,8 +263,12 @@ # parse description section $rcs =~ s|^\s*||s; - if ($rcs =~ s/^desc\s+\@($re_str)\@\s*//s) { - $self->{'rcs'}->{'header'}->{'desc'} = $1; + #if ($rcs =~ s/^desc\s+\@($re_str)\@\s*//s) { # would maximally span 32K + if ($rcs =~ s/^desc\s+\@//s) { + my $str = ''; + 1 while ($rcs =~ s/^((?:\@\@|[^@])+)/$str .= $1, ''/se); + $rcs =~ s/\@\s*//s; + $self->{'rcs'}->{'header'}->{'desc'} = &_string_unquote($str); push(@{$self->{'rcs'}->{'header'}->{-order}}, 'desc'); } @@ -271,15 +283,30 @@ my $textseen = 0; while (1) { $rcs =~ s|^\s*||s; - if ($rcs =~ s/^log\s+\@($re_str)\@\s*//s) { - $self->{'rcs'}->{'delta'}->{$rev}->{'log'} = &_string_unquote($1); - } - elsif ($rcs =~ s/^text\s+\@($re_str)\@\s*//s) { - $self->{'rcs'}->{'delta'}->{$rev}->{'text'} = &_string_unquote($1); + #if ($rcs =~ s/^log\s+\@($re_str)\@\s*//s) { # would maximally span 32K + if ($rcs =~ s/^log\s+\@//s) { + my $str = ''; + 1 while ($rcs =~ s/^((?:\@\@|[^@])+)/$str .= $1, ''/se); + $rcs =~ s/\@\s*//s; + $self->{'rcs'}->{'delta'}->{$rev}->{'log'} = &_string_unquote($str); + } + #elsif ($rcs =~ s/^text\s+\@($re_str)\@\s*//s) { # would maximally span 32K + elsif ($rcs =~ s/^text\s+\@//s) { + my $str = ''; + 1 while ($rcs =~ s/^((?:\@\@|[^@])+)/$str .= $1, ''/se); + $rcs =~ s/\@\s*//s; + $self->{'rcs'}->{'delta'}->{$rev}->{'text'} = &_string_unquote($str); $textseen = 1; } - elsif ($textseen == 0 and $rcs =~ s/^([a-z]+)(\s*[^;]*);//s) { - $self->{'rcs'}->{'delta'}->{$rev}->{$1} = $2; + #elsif ($textseen == 0 and $rcs =~ s/^([a-z]+)(?:\s+\@($re_str)\@\s*)?//s) { # would maximally span 32K + elsif ($textseen == 0 and $rcs =~ s/^([a-z]+)(?:\s+(\@))?//s) { + my ($keyword, $with_str) = ($1, $2); + my $str = ''; + if ($with_str) { + 1 while ($rcs =~ s/^((?:\@\@|[^@])+)/$str .= $1, ''/se); + $rcs =~ s/\@\s*//s; + } + $self->{'rcs'}->{'delta'}->{$rev}->{$keyword} = $str; } else { last;