Browse Source

* insure that env variable is only truncated if more than 255 chars after the equal sign

git-svn-id: trunk@6065 -
pierre 18 years ago
parent
commit
4bd7803e00
1 changed files with 3 additions and 1 deletions
  1. 3 1
      rtl/win/dos.pp

+ 3 - 1
rtl/win/dos.pp

@@ -806,7 +806,9 @@ begin
         i:=pos('=',s);
         if upcase(copy(s,1,i-1))=upcase(envvar) then
           begin
-             getenv:=copy(s,i+1,length(s)-i);
+             { getenv:=copy(s,i+1,length(s)-i);
+               this limits the size to 255-(i+1) }
+             getenv:=strpas(hp+i+1);
              break;
           end;
         { next string entry}