[fpc-pascal] Stupid ExcludeTrailingPathdelimiter question

Bart bartjunk64 at gmail.com
Sun May 12 11:33:38 CEST 2013


Hi,

I did not expect this:

ExcludeTrailingPathDelimiter(/) =  {Linux}
ExcludeTrailingPathDelimiter(\) =  {Windows/WinCE}
ExcludeTrailingPathDelimiter(c:\) = c:

Reasom I'm asking: Lazarus ShellTreeView crashes if you set Root :=
'/' (on Linux, and presumably on WinCe as well with Root := '\').

When trying to check if AValue exists it calls
DirectoryExistsUtf8(ExcludeTrailingPathDelimiter(ExpandFilename(AValue)))
This allows sloppy programmers, or sloppy users to set Root to
/home/user/ as well as /home/user, but it fails in th eabove mentioned
cases.

My Delphi is very old and does not have the
ExcludeTrailingPathDelimiter function, so I cannot test how Delphi
behaves.

Bart



More information about the fpc-pascal mailing list