OSDN Git Service

レスアンカー(>)でポップアップしなくなったので修正
authorh677 <h677>
Sun, 21 Sep 2008 03:06:45 +0000 (03:06 +0000)
committerh677 <h677>
Sun, 21 Sep 2008 03:06:45 +0000 (03:06 +0000)
GikoSystem.pas

index c9bc046..90d37ef 100644 (file)
@@ -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 := '';
                 // \8aJ\8en\83\8c\83X\94Ô\82Ì\8c\9f\8dõ
-                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;
                 // \8fI\97¹\83\8c\83X\94Ô\82Ì\8c\9f\8dõ
-                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;