|
@@ -705,19 +705,19 @@ Const
|
|
|
'/.'
|
|
|
);
|
|
|
var
|
|
|
- Drives : byte;
|
|
|
+ Drives : byte = 4;
|
|
|
DriveStr : array[4..26] of pchar;
|
|
|
|
|
|
Function AddDisk(const path:string) : Byte;
|
|
|
begin
|
|
|
if not (DriveStr[Drives]=nil) then
|
|
|
- FreeMem(DriveStr[Drives],StrLen(DriveStr[Drives])+1);
|
|
|
+ FreeMem(DriveStr[Drives]);
|
|
|
GetMem(DriveStr[Drives],length(Path)+1);
|
|
|
StrPCopy(DriveStr[Drives],path);
|
|
|
+ Result:=Drives;
|
|
|
inc(Drives);
|
|
|
if Drives>26 then
|
|
|
Drives:=4;
|
|
|
- Result:=Drives;
|
|
|
end;
|
|
|
|
|
|
|
|
@@ -746,6 +746,20 @@ Begin
|
|
|
End;
|
|
|
|
|
|
|
|
|
+Procedure FreeDriveStr;
|
|
|
+var
|
|
|
+ i: longint;
|
|
|
+begin
|
|
|
+ for i:=low(drivestr) to high(drivestr) do
|
|
|
+ if assigned(drivestr[i]) then
|
|
|
+ begin
|
|
|
+ freemem(drivestr[i]);
|
|
|
+ drivestr[i]:=nil;
|
|
|
+ end;
|
|
|
+end;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
Function GetCurrentDir : String;
|
|
|
begin
|
|
|
GetDir (0,Result);
|
|
@@ -1155,5 +1169,6 @@ Initialization
|
|
|
InitInternational; { Initialize internationalization settings }
|
|
|
SysConfigDir:='/etc'; { Initialize system config dir }
|
|
|
Finalization
|
|
|
+ FreeDriveStr;
|
|
|
DoneExceptions;
|
|
|
end.
|