mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 05:59:27 +02:00
* getenv case insensitive (merged)
This commit is contained in:
parent
3503b88e37
commit
9b1864c586
@ -103,8 +103,8 @@ Procedure Exec(const path: pathstr; const comline: comstr);
|
|||||||
Function DosExitCode: word;
|
Function DosExitCode: word;
|
||||||
|
|
||||||
{Disk}
|
{Disk}
|
||||||
Function DiskFree(drive: byte) : int64;
|
Function DiskFree(drive: byte) : int64;
|
||||||
Function DiskSize(drive: byte) : int64;
|
Function DiskSize(drive: byte) : int64;
|
||||||
Procedure FindFirst(const path: pathstr; attr: word; var f: searchRec);
|
Procedure FindFirst(const path: pathstr; attr: word; var f: searchRec);
|
||||||
Procedure FindNext(var f: searchRec);
|
Procedure FindNext(var f: searchRec);
|
||||||
Procedure FindClose(Var f: SearchRec);
|
Procedure FindClose(Var f: SearchRec);
|
||||||
@ -458,14 +458,12 @@ TYPE ExtendedFat32FreeSpaceRec=packed Record
|
|||||||
END;
|
END;
|
||||||
|
|
||||||
function do_diskdata(drive : byte; Free : BOOLEAN) : Int64;
|
function do_diskdata(drive : byte; Free : BOOLEAN) : Int64;
|
||||||
|
VAR
|
||||||
VAR S : String;
|
S : String;
|
||||||
Rec : ExtendedFat32FreeSpaceRec;
|
Rec : ExtendedFat32FreeSpaceRec;
|
||||||
|
|
||||||
BEGIN
|
BEGIN
|
||||||
if (swap(dosversion)>=$070A) AND LFNSupport then
|
if (swap(dosversion)>=$070A) AND LFNSupport then
|
||||||
begin
|
begin
|
||||||
DosError:=0;
|
|
||||||
S:='C:\'#0;
|
S:='C:\'#0;
|
||||||
if Drive=0 then
|
if Drive=0 then
|
||||||
begin
|
begin
|
||||||
@ -485,7 +483,6 @@ BEGIN
|
|||||||
dosregs.cx:=Sizeof(ExtendedFat32FreeSpaceRec);
|
dosregs.cx:=Sizeof(ExtendedFat32FreeSpaceRec);
|
||||||
dosregs.ax:=$7303;
|
dosregs.ax:=$7303;
|
||||||
msdos(dosregs);
|
msdos(dosregs);
|
||||||
LoadDosError;
|
|
||||||
copyfromdos(rec,Sizeof(ExtendedFat32FreeSpaceRec));
|
copyfromdos(rec,Sizeof(ExtendedFat32FreeSpaceRec));
|
||||||
if Free then
|
if Free then
|
||||||
Do_DiskData:=int64(rec.AvailAllocUnits)*rec.SecPerClus*rec.BytePerSec
|
Do_DiskData:=int64(rec.AvailAllocUnits)*rec.SecPerClus*rec.BytePerSec
|
||||||
@ -496,7 +493,6 @@ BEGIN
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
DosError:=0;
|
|
||||||
dosregs.dl:=drive;
|
dosregs.dl:=drive;
|
||||||
dosregs.ah:=$36;
|
dosregs.ah:=$36;
|
||||||
msdos(dosregs);
|
msdos(dosregs);
|
||||||
@ -512,8 +508,8 @@ BEGIN
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function diskfree(drive : byte) : int64;
|
|
||||||
|
|
||||||
|
function diskfree(drive : byte) : int64;
|
||||||
begin
|
begin
|
||||||
diskfree:=Do_DiskData(drive,TRUE);
|
diskfree:=Do_DiskData(drive,TRUE);
|
||||||
end;
|
end;
|
||||||
@ -725,7 +721,6 @@ var
|
|||||||
|
|
||||||
procedure swapvectors;
|
procedure swapvectors;
|
||||||
begin
|
begin
|
||||||
{ DosError:=0; Who added this !!!!! }
|
|
||||||
if _exception_exit<>nil then
|
if _exception_exit<>nil then
|
||||||
if _v2prt0_exceptions_on then
|
if _v2prt0_exceptions_on then
|
||||||
_swap_in()
|
_swap_in()
|
||||||
@ -1110,7 +1105,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
hs:=strpas(hp^);
|
hs:=strpas(hp^);
|
||||||
eqpos:=pos('=',hs);
|
eqpos:=pos('=',hs);
|
||||||
if copy(hs,1,eqpos-1)=envvar then
|
if upcase(copy(hs,1,eqpos-1))=envvar then
|
||||||
begin
|
begin
|
||||||
getenv:=copy(hs,eqpos+1,255);
|
getenv:=copy(hs,eqpos+1,255);
|
||||||
exit;
|
exit;
|
||||||
@ -1140,8 +1135,8 @@ End;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.5 2000-07-30 17:09:55 peter
|
Revision 1.6 2000-08-04 21:45:39 peter
|
||||||
* merged fixes
|
* getenv case insensitive (merged)
|
||||||
|
|
||||||
Revision 1.4 2000/07/22 12:24:55 jonas
|
Revision 1.4 2000/07/22 12:24:55 jonas
|
||||||
* merged dossearchrec2searchrec() fix from fixes branch
|
* merged dossearchrec2searchrec() fix from fixes branch
|
||||||
|
Loading…
Reference in New Issue
Block a user