Browse Source

* backward search hopefully fixed

git-svn-id: trunk@2077 -
Tomas Hajny 19 years ago
parent
commit
7d5d88d24f
1 changed files with 7 additions and 7 deletions
  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
 Var
   buffer : Array[0..MaxBufLength-1] of Byte Absolute block;
   buffer : Array[0..MaxBufLength-1] of Byte Absolute block;
   s2     : String;
   s2     : String;
-  len,
-  numb   : Sw_word;
+  len    : Sw_Word;
+  numb   : Sw_Integer;
   found  : Boolean;
   found  : Boolean;
 begin
 begin
   len:=length(str);
   len:=length(str);
@@ -1179,8 +1179,8 @@ begin
    end;
    end;
   s2[0]:=chr(len);       { sets the length to that of the search String }
   s2[0]:=chr(len);       { sets the length to that of the search String }
   found:=False;
   found:=False;
-  numb:=size-pred(len);
-  While (not found) and (numb>0) do
+  numb:=size-len;
+  While (not found) and (numb>=0) do
    begin
    begin
      { partial match }
      { partial match }
      if buffer[numb] = ord(str[1]) then
      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
 Var
   buffer : Array[0..MaxBufLength-1] of Char Absolute block;
   buffer : Array[0..MaxBufLength-1] of Char Absolute block;
   len,
   len,
-  numb,
-  x      : Sw_word;
+  x      : Sw_Word;
+  numb   : Sw_Integer;
   found  : Boolean;
   found  : Boolean;
   p      : pchar;
   p      : pchar;
   c      : char;
   c      : char;
@@ -1225,7 +1225,7 @@ begin
    end;
    end;
   found:=False;
   found:=False;
   numb:=size-len;
   numb:=size-len;
-  While (not found) and (numb>0) do
+  While (not found) and (numb>=0) do
    begin
    begin
      { partial match }
      { partial match }
      c:=buffer[numb];
      c:=buffer[numb];