Explorar o código

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

git-svn-id: trunk@6065 -
pierre %!s(int64=18) %!d(string=hai) anos
pai
achega
4bd7803e00
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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}