Browse Source

--- Merging r15241 into '.':
U rtl/unix/crt.pp
A tests/webtbs/tw15599.pp

# revisions: 15241
------------------------------------------------------------------------
r15241 | jonas | 2010-05-08 13:29:25 +0200 (Sat, 08 May 2010) | 3 lines
Changed paths:
M /trunk/rtl/unix/crt.pp
A /trunk/tests/webtbs/tw15599.pp

* update the coordinates properly if a string is written that exactly fills
a line (mantis #15599)

------------------------------------------------------------------------

git-svn-id: branches/fixes_2_4@15326 -

marco 15 years ago
parent
commit
e76cd959e1
3 changed files with 19 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 1 1
      rtl/unix/crt.pp
  3. 17 0
      tests/webtbs/tw15599.pp

+ 1 - 0
.gitattributes

@@ -9495,6 +9495,7 @@ tests/webtbs/tw15391.pp svneol=native#text/plain
 tests/webtbs/tw15446.pp svneol=native#text/plain
 tests/webtbs/tw15453a.pp svneol=native#text/plain
 tests/webtbs/tw15467.pp svneol=native#text/pascal
+tests/webtbs/tw15599.pp svneol=native#text/plain
 tests/webtbs/tw1567.pp svneol=native#text/plain
 tests/webtbs/tw15690.pp svneol=native#text/plain
 tests/webtbs/tw15693.pp svneol=native#text/plain

+ 1 - 1
rtl/unix/crt.pp

@@ -1142,7 +1142,7 @@ var
     while (SendBytes>0) do
      begin
        LeftX:=WindMaxX-CurrX+1;
-       if (SendBytes>LeftX) then
+       if (SendBytes>=LeftX) then
         begin
           ttyWrite(Copy(s,i-SendBytes,LeftX));
           dec(SendBytes,LeftX);

+ 17 - 0
tests/webtbs/tw15599.pp

@@ -0,0 +1,17 @@
+{ %interactive }
+
+{ the bug was that this put the 'x' at the *end* of the second line instead
+  of on position 14 }
+
+uses crt; // my terminal is 80x25
+var s:string;
+
+begin
+clrscr;
+s:='';
+gotoxy(1,2); // you need this row
+while length(s)<80 do s:=s+' ';
+write(s);
+gotoxy(14,2); // you need this row
+write('x'); // position of 'x' is wrong
+end.