mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-08 16:39:29 +01:00
lazutils: FileIsInPath: use ResolveDots instead of TrimFilename
git-svn-id: trunk@44835 -
This commit is contained in:
parent
cda481e98c
commit
22443c165c
@ -642,8 +642,8 @@ begin
|
||||
Result:=false;
|
||||
exit;
|
||||
end;
|
||||
ExpFile:=TrimFilename(Filename);
|
||||
ExpPath:=AppendPathDelim(TrimFilename(Path));
|
||||
ExpFile:=ResolveDots(Filename);
|
||||
ExpPath:=AppendPathDelim(ResolveDots(Path));
|
||||
l:=length(ExpPath);
|
||||
Result:=(l>0) and (length(ExpFile)>l) and (ExpFile[l]=PathDelim)
|
||||
and (CompareFilenames(ExpPath,LeftStr(ExpFile,l))=0);
|
||||
|
||||
@ -562,9 +562,9 @@ as needed by Windows file names like D:test.
|
||||
|
||||
<!-- function Visibility: default -->
|
||||
<element name="FileIsInPath">
|
||||
<short/>
|
||||
<descr>
|
||||
</descr>
|
||||
<short>Returns true if Filename is below Path</short>
|
||||
<descr>Path is a directory, Filename a file or directory. Returns true if Filename is a file or directory somewhere below Path. This is a logical test, so it does not check symlinks.
|
||||
For example under Unix the Filename '/usr/lib/fpc' is below Path '/usr/lib', '/usr' and '/'.</descr>
|
||||
<errors>
|
||||
</errors>
|
||||
<seealso>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user