mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-03 04:50:01 +01:00
codetools: directory cacher: fix compare unit and file
git-svn-id: trunk@32152 -
This commit is contained in:
parent
bb8ada822a
commit
92cd19f574
@ -366,6 +366,7 @@ function ComparePCharUnitNameWithFilename(UnitNameP, FilenameP: Pointer): intege
|
||||
var
|
||||
AUnitName: PChar absolute UnitNameP;
|
||||
Filename: PChar absolute FilenameP;
|
||||
ExtStart: PChar;
|
||||
begin
|
||||
while (FPUpChars[AUnitName^]=FPUpChars[Filename^]) and (AUnitName^<>#0) do begin
|
||||
inc(AUnitName);
|
||||
@ -376,19 +377,17 @@ begin
|
||||
if (Filename^='.') then begin
|
||||
// check extension
|
||||
inc(Filename);
|
||||
ExtStart:=Filename;
|
||||
while not (Filename^ in ['.',#0]) do inc(Filename);
|
||||
if Filename^='.' then begin
|
||||
// multi dots in filename
|
||||
Result:=ord(#0)-ord('.');
|
||||
Result:=ord(#0)-ord(FPUpChars[ExtStart^]);
|
||||
end else begin
|
||||
// rest is the extension => fits
|
||||
Result:=0;
|
||||
end;
|
||||
end else if Filename^=#0 then begin
|
||||
// file name has no extension => return not 0
|
||||
Result:=ord('.');
|
||||
end else
|
||||
Result:=ord(#0)-ord(FPUpChars[Filename^]);
|
||||
Result:=ord('.')-ord(FPUpChars[Filename^]);
|
||||
end else
|
||||
Result:=ord(FPUpChars[AUnitName^])-ord(FPUpChars[Filename^]);
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user