Browse Source

Taking advantage of fpc_ansistr_concat_multi

Alligator-1 1 year ago
parent
commit
c2bca23fd1
1 changed files with 5 additions and 5 deletions
  1. 5 5
      rtl/objpas/sysutils/sysformt.inc

+ 5 - 5
rtl/objpas/sysutils/sysformt.inc

@@ -411,13 +411,13 @@ begin
               end;
         '%': ToAdd:='%';
       end;
-      If Width<>-1 then
-        If Length(ToAdd)<Width then
+      If (Width<>-1) and (Length(ToAdd)<Width) then
           If not Left then
-            ToAdd:=TFormatString(Space(Width-Length(ToAdd)))+ToAdd
+            Result:=Result+TFormatString(Space(Width-Length(ToAdd)))+ToAdd
           else
-            ToAdd:=ToAdd+TFormatString(space(Width-Length(ToAdd)));
-      Result:=Result+ToAdd;
+            Result:=Result+ToAdd+TFormatString(space(Width-Length(ToAdd)))
+      else
+        Result:=Result+ToAdd;
       end;
     inc(ChPos);
     Oldpos:=ChPos;