• R/O
  • SSH
  • HTTPS

zerochplus: コミット


コミットメタ情報

リビジョン466 (tree)
日時2013-07-16 19:32:03
作者iroiro

ログメッセージ

zerochplus 0.7.x
・レス一覧でログ情報がずれる不具合を修正

変更サマリ

差分

--- zerochplus/trunk/test/mordor/thread.res.pl (revision 465)
+++ zerochplus/trunk/test/mordor/thread.res.pl (revision 466)
@@ -223,7 +223,7 @@
223223 my ($Page, $Sys, $Form, $Dat,$Logger) = @_;
224224 my (@elem, $resNum, $dispNum, $dispSt, $dispEd, $common, $i);
225225 my ($pRes, $isAbone, $isEdit, $isAccessUser, $format);
226- my ($log, @logs, $lastnum, $logsize);
226+ my ($log, @logs, $datsize, $logsize);
227227
228228 $Sys->Set('_TITLE', 'Res List');
229229
@@ -245,18 +245,41 @@
245245 $isEdit = $Sys->Get('ADMIN')->{'SECINFO'}->IsAuthority($Sys->Get('ADMIN')->{'USER'}, $ZP::AUTH_RESEDIT, $Sys->Get('BBS'));
246246 $isAccessUser = $Sys->Get('ADMIN')->{'SECINFO'}->IsAuthority($Sys->Get('ADMIN')->{'USER'}, $ZP::AUTH_ACCESUSER, $Sys->Get('BBS'));
247247
248- $lastnum = $Dat->Size() - 1;
248+ $datsize = $Dat->Size();
249249 $logsize = $Logger->Size();
250250
251- $lastnum -= 1 if ($Dat->IsStopped($Sys));
251+ $datsize -= 1 if ($Dat->IsStopped($Sys));
252252
253253 # レス一覧を出力
254+ my $offset = $logsize - $datsize;
254255 for ($i = $dispSt ; $i < $dispEd ; $i++) {
255256 $pRes = $Dat->Get($i);
256257 @elem = split(/<>/, $$pRes);
257- $log = $Logger->Get($logsize - 1 + $i - $lastnum);
258- @logs = split(/<>/,$log,-1) if (defined $log);
259258
259+ $log = $Logger->Get($offset + $i);
260+ @logs = split(/<>/, $log, -1) if (defined $log);
261+ if (defined $log && $logs[2] eq $elem[2]) {
262+ # ログとレスが一致
263+ } else {
264+ $log = $Logger->Get($offset-1 + $i);
265+ @logs = split(/<>/, $log, -1) if (defined $log);
266+ if (defined $log && $logs[2] eq $elem[2]) {
267+ # ログとレスが一致
268+ $offset--;
269+ } else {
270+ $log = $Logger->Get($offset+1 + $i);
271+ @logs = split(/<>/, $log, -1) if (defined $log);
272+ if (defined $log && $logs[2] eq $elem[2]) {
273+ # ログとレスが一致
274+ $offset++;
275+ } else {
276+ # ログ(±1)がレスに不一致
277+ $log = undef;
278+ @logs = ();
279+ }
280+ }
281+ }
282+
260283 foreach (0 .. $#logs) {
261284 $logs[$_] =~ s/[\x0d\x0a\0]//g;
262285 $logs[$_] =~ s/&/&amp;/g;
--- zerochplus/branches/0.7.x/test/mordor/thread.res.pl (revision 465)
+++ zerochplus/branches/0.7.x/test/mordor/thread.res.pl (revision 466)
@@ -223,7 +223,7 @@
223223 my ($Page, $Sys, $Form, $Dat,$Logger) = @_;
224224 my (@elem, $resNum, $dispNum, $dispSt, $dispEd, $common, $i);
225225 my ($pRes, $isAbone, $isEdit, $isAccessUser, $format);
226- my ($log, @logs, $lastnum, $logsize);
226+ my ($log, @logs, $datsize, $logsize);
227227
228228 $Sys->Set('_TITLE', 'Res List');
229229
@@ -245,18 +245,41 @@
245245 $isEdit = $Sys->Get('ADMIN')->{'SECINFO'}->IsAuthority($Sys->Get('ADMIN')->{'USER'}, $ZP::AUTH_RESEDIT, $Sys->Get('BBS'));
246246 $isAccessUser = $Sys->Get('ADMIN')->{'SECINFO'}->IsAuthority($Sys->Get('ADMIN')->{'USER'}, $ZP::AUTH_ACCESUSER, $Sys->Get('BBS'));
247247
248- $lastnum = $Dat->Size() - 1;
248+ $datsize = $Dat->Size();
249249 $logsize = $Logger->Size();
250250
251- $lastnum -= 1 if ($Dat->IsStopped($Sys));
251+ $datsize -= 1 if ($Dat->IsStopped($Sys));
252252
253253 # レス一覧を出力
254+ my $offset = $logsize - $datsize;
254255 for ($i = $dispSt ; $i < $dispEd ; $i++) {
255256 $pRes = $Dat->Get($i);
256257 @elem = split(/<>/, $$pRes);
257- $log = $Logger->Get($logsize - 1 + $i - $lastnum);
258- @logs = split(/<>/,$log,-1) if (defined $log);
259258
259+ $log = $Logger->Get($offset + $i);
260+ @logs = split(/<>/, $log, -1) if (defined $log);
261+ if (defined $log && $logs[2] eq $elem[2]) {
262+ # ログとレスが一致
263+ } else {
264+ $log = $Logger->Get($offset-1 + $i);
265+ @logs = split(/<>/, $log, -1) if (defined $log);
266+ if (defined $log && $logs[2] eq $elem[2]) {
267+ # ログとレスが一致
268+ $offset--;
269+ } else {
270+ $log = $Logger->Get($offset+1 + $i);
271+ @logs = split(/<>/, $log, -1) if (defined $log);
272+ if (defined $log && $logs[2] eq $elem[2]) {
273+ # ログとレスが一致
274+ $offset++;
275+ } else {
276+ # ログ(±1)がレスに不一致
277+ $log = undef;
278+ @logs = ();
279+ }
280+ }
281+ }
282+
260283 foreach (0 .. $#logs) {
261284 $logs[$_] =~ s/[\x0d\x0a\0]//g;
262285 $logs[$_] =~ s/&/&amp;/g;
旧リポジトリブラウザで表示