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

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sat Jun 20 13:47:51 CEST 2015


On 18/06/15 23:36, Mark Cave-Ayland wrote:

> 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>
> ---
>  openbios-devel/forth/bootstrap/interpreter.fs |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/openbios-devel/forth/bootstrap/interpreter.fs b/openbios-devel/forth/bootstrap/interpreter.fs
> index 5187058..74a109f 100644
> --- a/openbios-devel/forth/bootstrap/interpreter.fs
> +++ b/openbios-devel/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 - 
>        (evaluate)
>        i 1+ 

While this seems to be correct, further testing shows that yaboot (which
has some embedded \r codes in its Forth strings) emits warnings on the
console with this patch applied. Will dig a bit deeper to try and figure
out what is going on here.


ATB,

Mark.




More information about the OpenBIOS mailing list