• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

ギコナビ


Commit MetaInfo

Revision152981b0ddaf48f004b1b779455848decd6bcd37 (tree)
Time2005-06-20 23:11:40
Authorh677 <h677>
Commiterh677

Log Message

ReadBoardFile中に、おかしなURL等でBoardオブジェクトを作成できない時の例外を
可能な限りキャッチして、他に問題が広がらないようにした。

Change Summary

Incremental Difference

--- a/GikoSystem.pas
+++ b/GikoSystem.pas
@@ -1995,13 +1995,16 @@ begin
19951995 url := Trim(url);
19961996
19971997 if url = '' then Exit;
1998-
1999- url := Copy(url, 0, Length(url) - 1);
2000- for i := Length(url) downto 0 do begin
2001- if url[i] = '/' then begin
2002- Result := Copy(url, i + 1, Length(url));
2003- Break;
1998+ try
1999+ url := Copy(url, 0, Length(url) - 1);
2000+ for i := Length(url) downto 0 do begin
2001+ if url[i] = '/' then begin
2002+ Result := Copy(url, i + 1, Length(url));
2003+ Break;
2004+ end;
20042005 end;
2006+ except
2007+ Result := '';
20052008 end;
20062009 end;
20072010
@@ -3754,6 +3757,8 @@ begin
37543757 for j := 0 to jBound do begin
37553758 Board := nil;
37563759 inistr := ini.ReadString(CategoryList[i], BoardList[j], '');
3760+ //'http://'‚ðŠÜ‚Ü‚È‚¢•¶Žš—ñ‚ÌŽž‚Í–³Ž‹‚·‚é
3761+ if (AnsiPos('http://', AnsiLowerCase(inistr)) = 0) then Continue;
37573762 //===== ƒvƒ‰ƒOƒCƒ“
37583763 try
37593764 kBound := Length(BoardGroups) - 1;
@@ -3764,18 +3769,28 @@ begin
37643769 tmpstring := BoardGroups[k].BoardPlugIn.ExtractBoardURL( inistr );
37653770 if AnsiCompareStr(tmpString, inistr) <> 0 then begin
37663771 if not BoardGroups[k].Find(tmpstring, p) then begin
3767- Board := TBoard.Create( BoardGroups[k].BoardPlugIn, tmpstring );
3768- BoardGroups[k].AddObject(tmpstring, Board);
3769- Category.Add(Board);
3772+ try
3773+ Board := TBoard.Create( BoardGroups[k].BoardPlugIn, tmpstring );
3774+ BoardGroups[k].AddObject(tmpstring, Board);
3775+ Category.Add(Board);
3776+ except
3777+ //‚±‚±‚É—ˆ‚é‚Æ‚µ‚½‚çBoard‚̍쐬‚ÉŽ¸”s‚µ‚½‚Æ‚«‚¾‚©‚çBoard‚ðnil‚É‚·‚é
3778+ Board := nil;
3779+ end;
37703780 end else begin
37713781 Board := TBoard(BoardGroups[k].Objects[p]);
37723782 if Board.ParentCategory <> Category then
37733783 Category.Add(Board);
37743784 end;
37753785 end else begin
3776- Board := TBoard.Create( BoardGroups[k].BoardPlugIn, tmpstring );
3777- BoardGroups[k].AddObject(tmpstring, Board);
3778- Category.Add(Board);
3786+ try
3787+ Board := TBoard.Create( BoardGroups[k].BoardPlugIn, tmpstring );
3788+ BoardGroups[k].AddObject(tmpstring, Board);
3789+ Category.Add(Board);
3790+ except
3791+ //‚±‚±‚É—ˆ‚é‚Æ‚µ‚½‚çBoard‚̍쐬‚ÉŽ¸”s‚µ‚½‚Æ‚«‚¾‚©‚çBoard‚ðnil‚É‚·‚é
3792+ Board := nil;
3793+ end;
37793794 end;
37803795 end else begin
37813796 Board := TBoard(BoardGroups[k].Objects[p]);
@@ -3789,39 +3804,33 @@ begin
37893804 except
37903805 // exception ‚ª”­¶‚µ‚½ê‡‚Í“à•”ˆ—‚É”C‚¹‚½‚¢‚Ì‚Å‚±‚±‚ł͉½‚à‚µ‚È‚¢
37913806 end;
3792- if (Board = nil) then begin
3793- if not BoardGroups[0].Find(inistr,p) then begin
3794- Board := TBoard.Create( nil, inistr );
3795- BoardGroups[0].AddObject(inistr, Board);
3796- Category.Add(Board);
3797- end else begin
3798- Board := TBoard(BoardGroups[0].Objects[p]);
3799- if Board.ParentCategory <> Category then
3807+ try
3808+ if (Board = nil) then begin
3809+ if not BoardGroups[0].Find(inistr,p) then begin
3810+ Board := TBoard.Create( nil, inistr );
3811+ BoardGroups[0].AddObject(inistr, Board);
38003812 Category.Add(Board);
3813+ end else begin
3814+ Board := TBoard(BoardGroups[0].Objects[p]);
3815+ if Board.ParentCategory <> Category then
3816+ Category.Add(Board);
3817+ end;
38013818 end;
3802- end;
38033819
3804- if (Board.No = 0) then begin
3805- Board.BeginUpdate;
3806- Board.No := j + 1;
3807- Board.Title := BoardList[j];
3808- Board.RoundDate := ZERO_DATE;
3809-
3810- {idx := RoundList.Find(Board);
3811- if idx <> -1 then begin
3812- RoundItem := RoundList.Items[idx, grtBoard];
3813- Board.Round := True;
3814- Board.RoundName := RoundItem.RoundName;
3820+ if (Board.No = 0) then begin
3821+ Board.BeginUpdate;
3822+ Board.No := j + 1;
3823+ Board.Title := BoardList[j];
3824+ Board.RoundDate := ZERO_DATE;
3825+
3826+ Board.Multiplicity := 0;
3827+ Board.LoadSettings;
3828+ Board.EndUpdate;
3829+ end else begin
3830+ Board.No := j + 1;
3831+ Board.Multiplicity := Board.Multiplicity + 1;
38153832 end;
3816- }
3817- Board.Multiplicity := 0;
3818- //Category.Add(Board);
3819- Board.LoadSettings;
3820- Board.EndUpdate;
3821- end else begin
3822- Board.No := j + 1;
3823- Board.Multiplicity := Board.Multiplicity + 1;
3824- //Category.Add(Board);
3833+ except
38253834 end;
38263835 end;
38273836 bbs.Add( Category );