* fix for GetShortName, now checks results from Win32

This commit is contained in:
pierre 2000-01-20 00:23:03 +00:00
parent c449017899
commit 08cb7daa9f

View File

@ -1240,7 +1240,7 @@ implementation
repeat repeat
i:=pos(';',path); i:=pos(';',path);
if i=0 then if i=0 then
i:=255; i:=256;
singlepathstring:=FixPath(copy(path,1,i-1),false); singlepathstring:=FixPath(copy(path,1,i-1),false);
delete(path,1,i); delete(path,1,i);
If FileExists (singlepathstring+f) then If FileExists (singlepathstring+f) then
@ -1267,6 +1267,7 @@ implementation
{$ifdef win32} {$ifdef win32}
var var
hs,hs2 : string; hs,hs2 : string;
i : longint;
{$endif} {$endif}
{$ifdef go32v2} {$ifdef go32v2}
var var
@ -1276,9 +1277,12 @@ implementation
GetShortName:=n; GetShortName:=n;
{$ifdef win32} {$ifdef win32}
hs:=n+#0; hs:=n+#0;
Windows.GetShortPathName(@hs[1],@hs2[1],high(hs2)); i:=Windows.GetShortPathName(@hs[1],@hs2[1],high(hs2));
hs2[0]:=chr(strlen(@hs2[1])); if (i>0) and (i<=high(hs2)) then
GetShortName:=hs2; begin
hs2[0]:=chr(strlen(@hs2[1]));
GetShortName:=hs2;
end;
{$endif} {$endif}
{$ifdef go32v2} {$ifdef go32v2}
hs:=n; hs:=n;
@ -1472,7 +1476,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.46 2000-01-07 01:14:27 peter Revision 1.47 2000-01-20 00:23:03 pierre
* fix for GetShortName, now checks results from Win32
Revision 1.46 2000/01/07 01:14:27 peter
* updated copyright to 2000 * updated copyright to 2000
Revision 1.45 2000/01/07 00:08:09 peter Revision 1.45 2000/01/07 00:08:09 peter
@ -1624,5 +1631,4 @@ end.
Revision 1.8.2.1 1999/07/07 07:53:21 michael Revision 1.8.2.1 1999/07/07 07:53:21 michael
+ Merged patches from florian + Merged patches from florian
} }