瀏覽代碼

* backward search hopefully fixed

git-svn-id: trunk@2077 -
Tomas Hajny 19 年之前
父節點
當前提交
7d5d88d24f
共有 1 個文件被更改,包括 7 次插入7 次删除
  1. 7 7
      ide/weditor.pas

+ 7 - 7
ide/weditor.pas

@@ -1167,8 +1167,8 @@ function BMBScan(var Block; Size: Sw_Word;const Str: String;const bt:BTable): Sw
 Var
   buffer : Array[0..MaxBufLength-1] of Byte Absolute block;
   s2     : String;
-  len,
-  numb   : Sw_word;
+  len    : Sw_Word;
+  numb   : Sw_Integer;
   found  : Boolean;
 begin
   len:=length(str);
@@ -1179,8 +1179,8 @@ begin
    end;
   s2[0]:=chr(len);       { sets the length to that of the search String }
   found:=False;
-  numb:=size-pred(len);
-  While (not found) and (numb>0) do
+  numb:=size-len;
+  While (not found) and (numb>=0) do
    begin
      { partial match }
      if buffer[numb] = ord(str[1]) then
@@ -1211,8 +1211,8 @@ function BMBIScan(var Block; Size: Sw_Word;const Str: String;const bt:BTable): S
 Var
   buffer : Array[0..MaxBufLength-1] of Char Absolute block;
   len,
-  numb,
-  x      : Sw_word;
+  x      : Sw_Word;
+  numb   : Sw_Integer;
   found  : Boolean;
   p      : pchar;
   c      : char;
@@ -1225,7 +1225,7 @@ begin
    end;
   found:=False;
   numb:=size-len;
-  While (not found) and (numb>0) do
+  While (not found) and (numb>=0) do
    begin
      { partial match }
      c:=buffer[numb];