[Lazarus] FileExistsUTF8 and long paths

Bart bartjunk64 at gmail.com
Sun Jan 17 17:42:49 CET 2016


On 1/17/16, Jürgen Hestermann <juergen.hestermann at gmx.de> wrote:

> BTW:
> The following code in ExpandFileNameUtf8 seems to be not quite correct:
>
>   if (Length(Fn) > 3) and (Fn[1] = PathDelim) and (Fn[2] = PathDelim) and
>       (Fn[3] = '?') and (Fn[4] = PathDelim) //Do NOT use
> AllowDirectorySeparators here!
>      then Exit;
>
> When PathDelim='/' it would make no sense.

You are wrong.
The code in question is in a includefile that is only included under
Windows, where PathDelim = DirectorySeparator = '\', always (it's a
constant).

The filename should have been a clue here (as is the include direcory
of it's main unit file):
($lazarus)\components\lazutils\winlazfileutils.inc.
I just preferred writing PathDelim when I wrote that piece of code.

Bart




More information about the Lazarus mailing list