Browse Source

* fix a move in an unicodestring routine (now ansistring + assignment) win32 make all works again.

git-svn-id: branches/unicode@24746 -
marco 12 years ago
parent
commit
9f0985fd0b
1 changed files with 5 additions and 4 deletions
  1. 5 4
      rtl/objpas/objpas.pp

+ 5 - 4
rtl/objpas/objpas.pp

@@ -266,7 +266,7 @@ end;
 Function ParamStr(Param : Integer) : unicodestring;
 Function ParamStr(Param : Integer) : unicodestring;
 
 
 Var Len : longint;
 Var Len : longint;
-
+    s   : ansistring;
 begin
 begin
 {
 {
   Paramstr(0) should return the name of the binary.
   Paramstr(0) should return the name of the binary.
@@ -283,12 +283,13 @@ begin
     Len:=0;
     Len:=0;
     While Argv[Param][Len]<>#0 do
     While Argv[Param][Len]<>#0 do
       Inc(len);
       Inc(len);
-    SetLength(Result,Len);
+    SetLength(s,Len);
     If Len>0 then
     If Len>0 then
-      Move(Argv[Param][0],Result[1],Len);
+      Move(Argv[Param][0],s[1],Len);
+     result:=s;
     end
     end
   else
   else
-    paramstr:='';
+    Result:='';
 end;
 end;
 {$endif FPC_HAS_FEATURE_COMMANDARGS}
 {$endif FPC_HAS_FEATURE_COMMANDARGS}