diff --git a/rtl/unix/dos.pp b/rtl/unix/dos.pp index 07c9522537..8e228a09dd 100644 --- a/rtl/unix/dos.pp +++ b/rtl/unix/dos.pp @@ -51,7 +51,7 @@ Procedure UnixDateToDt(SecsPast: LongInt; Var Dt: DateTime); Function DTToUnixDate(DT: DateTime): LongInt; {Disk} -Procedure AddDisk(const path:string); +Function AddDisk(const path:string) : byte; Implementation @@ -384,7 +384,7 @@ const var DriveStr : array[4..26] of pchar; -Procedure AddDisk(const path:string); +Function AddDisk(const path:string) : byte; begin if not (DriveStr[Drives]=nil) then FreeMem(DriveStr[Drives],StrLen(DriveStr[Drives])+1); @@ -392,7 +392,8 @@ begin StrPCopy(DriveStr[Drives],path); inc(Drives); if Drives>26 then - Drives:=4; + Drives:=4; + AddDisk:=Drives; end; diff --git a/rtl/unix/sysutils.pp b/rtl/unix/sysutils.pp index e0e39af124..2928f37c65 100644 --- a/rtl/unix/sysutils.pp +++ b/rtl/unix/sysutils.pp @@ -38,7 +38,7 @@ uses { Include platform independent interface part } {$i sysutilh.inc} -Procedure AddDisk(const path:string); +Function AddDisk(const path:string) : Byte; { the following is Kylix compatibility stuff, it should be moved to a special compatibilty unit (FK) } @@ -717,7 +717,7 @@ var Drives : byte; DriveStr : array[4..26] of pchar; -Procedure AddDisk(const path:string); +Function AddDisk(const path:string) : Byte; begin if not (DriveStr[Drives]=nil) then FreeMem(DriveStr[Drives],StrLen(DriveStr[Drives])+1); @@ -726,6 +726,7 @@ begin inc(Drives); if Drives>26 then Drives:=4; + Result:=Drives; end;