From a0733fde8cf812d4f83a71aeaef4e5a3e4010978 Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 18 Jan 2006 09:43:37 +0000 Subject: [PATCH] fixed CompareTextIgnoringSpace for space ahead in Txt1 git-svn-id: trunk@8550 - --- components/codetools/basiccodetools.pas | 11 +++++++++-- components/codetools/fileprocs.pas | 10 ++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/components/codetools/basiccodetools.pas b/components/codetools/basiccodetools.pas index 0719db872c..30785a10c5 100644 --- a/components/codetools/basiccodetools.pas +++ b/components/codetools/basiccodetools.pas @@ -2109,7 +2109,7 @@ begin end; function CompareTextIgnoringSpace(Txt1: PChar; Len1: integer; - Txt2: PChar; Len2: integer; CaseSensitive: boolean): integer; + Txt2: PChar; Len2: integer; CaseSensitive: boolean): integer; { Txt1 Txt2 Result A A 0 A B 1 @@ -2123,6 +2123,7 @@ begin P2:=0; InIdentifier:=false; while (P1=Len2) or (ord(Txt2[P2])>ord(' ')); + end; end else if (ord(Txt2[P2])<=ord(' ')) then begin // ignore/skip spaces in Txt2 repeat @@ -3316,7 +3323,7 @@ begin copy(SearchPath,PathStartPos,PathEndPos-PathStartPos))); if not FilenameIsAbsolute(CurDir) then CurDir:=AppendPathDelim(BaseDir)+CurDir; - if not SearchDirectory(AppendPathDelim(CurDir)) then exit; + if not SearchDirectory(CurDir) then exit; end; PathStartPos:=PathEndPos; while (PathStartPos<=length(SearchPath)) diff --git a/components/codetools/fileprocs.pas b/components/codetools/fileprocs.pas index 058d8714fb..25d8226da1 100644 --- a/components/codetools/fileprocs.pas +++ b/components/codetools/fileprocs.pas @@ -115,6 +115,7 @@ procedure DbgOut(const s1,s2,s3,s4: string); procedure DbgOut(const s1,s2,s3,s4,s5: string); procedure DbgOut(const s1,s2,s3,s4,s5,s6: string); +function DbgS(const c: char): string; function DbgS(const c: cardinal): string; function DbgS(const i: integer): string; function DbgS(const r: TRect): string; @@ -1158,6 +1159,15 @@ begin DbgOut(s1+s2+s3+s4+s5+s6); end; +function DbgS(const c: char): string; +begin + case c of + ' '..#126: Result:=c; + else + Result:='#'+IntToStr(ord(c)); + end; +end; + function DbgS(const c: cardinal): string; begin Result:=IntToStr(c);