LazFileUtils: use AllowDirectorySeparators instead of hardcode '\' in FilenameIsWinAbsolute().

git-svn-id: trunk@42663 -
This commit is contained in:
bart 2013-09-07 11:26:20 +00:00
parent 2139b17c5c
commit 82d7e00939

View File

@ -144,11 +144,11 @@ end;
function FilenameIsWinAbsolute(const TheFilename: string): boolean;
begin
{$ifdef wince}
Result := (Length(TheFilename) > 0) and (TheFilename[1] = '\');
Result := (Length(TheFilename) > 0) and (TheFilename[1] in AllowDirectorySeparators);
{$else wince}
Result:=((length(TheFilename)>=3) and
(TheFilename[1] in ['A'..'Z','a'..'z']) and (TheFilename[2]=':') and (TheFilename[3]='\'))
or ((length(TheFilename)>=2) and (TheFilename[1]='\') and (TheFilename[2]='\'))
(TheFilename[1] in ['A'..'Z','a'..'z']) and (TheFilename[2]=':') and (TheFilename[3]in AllowDirectorySeparators))
or ((length(TheFilename)>=2) and (TheFilename[1] in AllowDirectorySeparators) and (TheFilename[2] in AllowDirectorySeparators))
;
{$endif wince}
end;