[fpc-pascal]Bug in FExpand (ver. 1.06 for Win32)
Rich Pasco
pasco at acm.org
Thu May 9 22:38:36 CEST 2002
Here's a bug in the FExpand procedure in the DOS unit of released
version 1.06 for the Win32 platform:
Calling FExpand with a UNC path "poisons" it so that it fails with
subsequent drive-letter based paths.
Here is my source code for "fexptest.pas":
uses DOS;
procedure Expand(FileMask: string);
begin
WriteLn;
WriteLn('Expanding "',FileMask,'"');
FileMask := FExpand(FileMask);
WriteLn('To become "',FileMask,'"');
end;
begin
Expand('C:\out\music\Rock and Roll');
Expand('\\pasco\shared\My Music\rock and roll');
Expand('C:\out\music\Rock and Roll');
end.
Here is the output, when running it with the current directory is
"C:\test". Note that the first and third trials use the same input,
but that the output is incorrect in the third trial.
C:\test>fexptest
Expanding "C:\out\music\Rock and Roll"
To become "C:\out\music\Rock and Roll"
Expanding "\\pasco\shared\My Music\rock and roll"
To become "\\pasco\shared\My Music\rock and roll"
Expanding "C:\out\music\Rock and Roll"
To become "C:\test\ock and Roll"
I hope this helps lead to a rapid resolution.
- Rich
More information about the fpc-pascal
mailing list