Browse Source

* getenv case insensitive (merged)

peter 25 years ago
parent
commit
9b1864c586
1 changed files with 9 additions and 14 deletions
  1. 9 14
      rtl/go32v2/dos.pp

+ 9 - 14
rtl/go32v2/dos.pp

@@ -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  DiskSize(drive: byte) : int64;
+Function  DiskFree(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 S    : String;
-    Rec  : ExtendedFat32FreeSpaceRec;
-
+VAR
+  S    : String;
+  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
-    * merged fixes
+  Revision 1.6  2000-08-04 21:45:39  peter
+    * 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