[OpenBIOS] [PATCHv2 3/3] interpreter.fs: allow evaluate to split words on CR as well as LF

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sun Jul 17 23:31:46 CEST 2016


From: Cormac O'Brien <cormac at c-obrien.org>

Otherwise the Forth intepreter fails due to lack of buffer space when
trying to execute large boot scripts on platforms that use CR instead
of LF for line endings (particularly MacOS 9).

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
Signed-off-by: Cormac O'Brien <cormac at c-obrien.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
 forth/bootstrap/interpreter.fs |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/forth/bootstrap/interpreter.fs b/forth/bootstrap/interpreter.fs
index b66e95e..f02000f 100644
--- a/forth/bootstrap/interpreter.fs
+++ b/forth/bootstrap/interpreter.fs
@@ -163,7 +163,7 @@ defer outer-interpreter
 : evaluate ( str len -- ?? )
   2dup + -rot
   over + over do 
-    i c@ 0a = if 
+    i c@ dup 0a = swap 0d = or if
       i over - 
       rot >r
       (evaluate)
-- 
1.7.10.4




More information about the OpenBIOS mailing list