Browse Source

* clarify environment processing

git-svn-id: trunk@17942 -
pierre 14 years ago
parent
commit
c529921fc8
1 changed files with 14 additions and 10 deletions
  1. 14 10
      tests/utils/dotest.pp

+ 14 - 10
tests/utils/dotest.pp

@@ -1082,9 +1082,6 @@ end;
 
 
 
 
 procedure getargs;
 procedure getargs;
-var
-  para : string;
-  i  : longint;
 
 
   procedure helpscreen;
   procedure helpscreen;
   begin
   begin
@@ -1116,11 +1113,12 @@ var
     halt(1);
     halt(1);
   end;
   end;
 
 
-  procedure interpret_option (arg : string);
+  procedure interpret_option (para : string);
   var
   var
     ch : char;
     ch : char;
     j : longint;
     j : longint;
   begin
   begin
+   Verbose(V_Debug,'Interpreting  option"'+para+'"');
     ch:=Upcase(para[2]);
     ch:=Upcase(para[2]);
     delete(para,1,2);
     delete(para,1,2);
     case ch of
     case ch of
@@ -1209,9 +1207,11 @@ var
    para : string;
    para : string;
    pspace : longint;
    pspace : longint;
  begin
  begin
+   Verbose(V_Debug,'Interpreting environment option"'+arg+'"');
    { Get rid of leading '!' }
    { Get rid of leading '!' }
    delete(arg,1,1);
    delete(arg,1,1);
    arg:=getenv(arg);
    arg:=getenv(arg);
+   Verbose(V_Debug,'Environment value is "'+arg+'"');
    while (length(arg)>0) do
    while (length(arg)>0) do
      begin
      begin
        while (length(arg)>0) and (arg[1]=' ') do
        while (length(arg)>0) and (arg[1]=' ') do
@@ -1231,18 +1231,22 @@ var
      end;
      end;
  end;
  end;
 
 
+var
+  param : string;
+  i  : longint;
+
 begin
 begin
   CompilerBin:='ppc386'+srcexeext;
   CompilerBin:='ppc386'+srcexeext;
   for i:=1 to paramcount do
   for i:=1 to paramcount do
    begin
    begin
-     para:=Paramstr(i);
-     if (para[1]='-') then
-      interpret_option(para)
-     else if (para[1]='!') then
-       interpret_env(para)
+     param:=Paramstr(i);
+     if (param[1]='-') then
+      interpret_option(param)
+     else if (param[1]='!') then
+       interpret_env(param)
      else
      else
        begin
        begin
-         PPFile.Insert(current,ForceExtension(Para,'pp'));
+         PPFile.Insert(current,ForceExtension(Param,'pp'));
          inc(current);
          inc(current);
        end;
        end;
    end;
    end;