mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 21:10:36 +02:00
Converter: Improve IsRootPath function. Issue #22630, patch from Bart Broersma
git-svn-id: trunk@38290 -
This commit is contained in:
parent
8297ee1f08
commit
d50b5d1cd8
@ -401,13 +401,14 @@ procedure TCacheUnitsThread.Execute;
|
|||||||
|
|
||||||
function IsRootPath(APath: String): Boolean;
|
function IsRootPath(APath: String): Boolean;
|
||||||
//crude function, it maybe needs support for UNC drives
|
//crude function, it maybe needs support for UNC drives
|
||||||
|
var
|
||||||
|
D: String;
|
||||||
|
Len: Integer;
|
||||||
begin
|
begin
|
||||||
{$ifdef windows}
|
D := ExtractFileDrive(APath);
|
||||||
Result := ((Length(APath) = 3) and (APath[1] in ['a'..'z','A'..'Z']) and (APath[2] = ':') and (APath[3] = PathDelim))
|
Len := Length(D);
|
||||||
or (APath = PathDelim);
|
System.Delete(APath, 1, Len);
|
||||||
{$else}
|
Result := (Length(APath) = 1) and (APath[1] in AllowDirectorySeparators);
|
||||||
Result := (APath = PathDelim);
|
|
||||||
{$endif}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user