From d970b3d0b0bf549b213837b5c85cbb79c2a9ae45 Mon Sep 17 00:00:00 2001 From: h677 Date: Sun, 21 Sep 2008 03:06:45 +0000 Subject: [PATCH] =?utf8?q?=E3=83=AC=E3=82=B9=E3=82=A2=E3=83=B3=E3=82=AB?= =?utf8?q?=E3=83=BC(>)=E3=81=A7=E3=83=9D=E3=83=83=E3=83=97=E3=82=A2?= =?utf8?q?=E3=83=83=E3=83=97=E3=81=97=E3=81=AA=E3=81=8F=E3=81=AA=E3=81=A3?= =?utf8?q?=E3=81=9F=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- GikoSystem.pas | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/GikoSystem.pas b/GikoSystem.pas index c9bc046..90d37ef 100644 --- a/GikoSystem.pas +++ b/GikoSystem.pas @@ -1904,8 +1904,23 @@ var i, j, idx : Integer; begin URL := Trim(LowerCase(URL)); - idx := AnsiPos('?', URL); + for i := 0 to Length(START_NAME) -1 do begin + idx := AnsiPos(START_NAME[i], URL); + if (idx <> 0) then begin + break; + end; + idx := AnsiPos(END_NAME[i], URL); + if (idx <> 0) then begin + break; + end; + + end; + if (idx <> 0) then begin + idx := AnsiPos('?', URL); + if (idx = 0) then begin + idx := LastDelimiter('/', URL); + end; stRes := 0; endRes := 0; bufList := TStringList.Create(); @@ -1915,19 +1930,21 @@ begin for i := 0 to bufList.Count - 1 do begin convBuf := ''; // ŠJŽnƒŒƒX”Ô‚ÌŒŸõ - for j := 0 to Length(START_NAME) - 1 do begin - idx := AnsiPos(START_NAME[j], bufList[i]); - if (idx <> 0) then begin - convBuf := Copy(bufList[i], idx + Length(START_NAME[j]), Length(bufList[i])); - stRes := StrToInt64Def( convBuf, 0 ); - break; + if (stRes = 0) then begin + for j := 0 to Length(START_NAME) - 1 do begin + idx := AnsiPos(START_NAME[j], bufList[i]); + if (idx = 1) then begin + convBuf := Copy(bufList[i], idx + Length(START_NAME[j]), Length(bufList[i])); + stRes := StrToInt64Def( convBuf, 0 ); + break; + end; end; end; // I—¹ƒŒƒX”Ô‚ÌŒŸõ - if (convBuf = '') then begin + if (convBuf = '') and (endRes = 0) then begin for j := 0 to Length(END_NAME) - 1 do begin idx := AnsiPos(END_NAME[j], bufList[i]); - if (idx <> 0) then begin + if (idx = 1) then begin convBuf := Copy(bufList[i], idx + Length(END_NAME[j]), Length(bufList[i])); endRes := StrToInt64Def( convBuf, 0 ); break; @@ -1938,7 +1955,7 @@ begin if ((stRes = 0) and (endRes = 0) and (convBuf = '')) then begin for j := 0 to Length(RES_NAME) - 1 do begin idx := AnsiPos(RES_NAME[j], bufList[i]); - if (idx <> 0) then begin + if (idx = 1) then begin convBuf := Copy(bufList[i], idx + Length(RES_NAME[j]), Length(bufList[i])); stRes := StrToInt64Def( convBuf, 0 ); endRes := stRes; -- 2.11.0