Suppress CR in quiet mode, patch by Derek Fawcus.
[pforth] / fth / history.fth
index 5e5409e..176d187 100644 (file)
@@ -51,6 +51,8 @@ KH-HISTORY kh_history_size erase
 \ The most recent entry is put at the beginning,\r
 \ older entries are shifted up.\r
 \r
 \ The most recent entry is put at the beginning,\r
 \ older entries are shifted up.\r
 \r
+4 constant KH_LINE_EXTRA_SIZE ( 2 count bytes plus 2 size bytes )\r
+\r
 : KH-END ( -- addr , end of history buffer )\r
        kh-history kh_history_size +\r
 ;\r
 : KH-END ( -- addr , end of history buffer )\r
        kh-history kh_history_size +\r
 ;\r
@@ -132,7 +134,9 @@ variable KH-INSIDE        ( true if we are scrolling inside the history buffer )
                        >r ( save count )\r
 \ Set look pointer to point to first count byte of last string.\r
                        0 kh-look !\r
                        >r ( save count )\r
 \ Set look pointer to point to first count byte of last string.\r
                        0 kh-look !\r
-                       r@ cell+ kh.make.room\r
+\ Make room for this line of text and line header. \r
+\ PLB20100823 Was cell+ which broke on 64-bit code.\r
+                       r@ KH_LINE_EXTRA_SIZE + kh.make.room\r
 \ Set count bytes at beginning and end.\r
                        r@ kh-history c!  ( start count )\r
                        r@ kh.endcount.addr c!\r
 \ Set count bytes at beginning and end.\r
                        r@ kh-history c!  ( start count )\r
                        r@ kh.endcount.addr c!\r