Browse Source

* Merging revisions 166 from trunk:
------------------------------------------------------------------------
r166 | michael | 2018-10-17 23:36:40 +0200 (Wed, 17 Oct 2018) | 1 line

* Fix stringofchar for count<=0
------------------------------------------------------------------------

michael 6 years ago
parent
commit
373517e9df
1 changed files with 3 additions and 0 deletions
  1. 3 0
      packages/rtl/system.pas

+ 3 - 0
packages/rtl/system.pas

@@ -590,6 +590,9 @@ function StringOfChar(c: Char; l: NativeInt): String;
 var
 var
   i: Integer;
   i: Integer;
 begin
 begin
+  asm
+    if ((l>0) && c.repeat) return c.repeat(l);
+  end;
   Result:='';
   Result:='';
   for i:=1 to l do Result:=Result+c;
   for i:=1 to l do Result:=Result+c;
 end;
 end;