1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-27 14:58:06 +11:00

readln: rename (c<) to (rdln<)

so that it isn't picked up automatically at boot. Only when (c<$) is
called do we override (c<). This fixes tricky boot problems.
This commit is contained in:
Virgil Dupras 2020-04-12 14:01:54 -04:00
parent d6c9ab3f32
commit 420836276d

View File

@ -19,17 +19,6 @@
( set IN> to IN( and set IN> @ to null )
: (infl) 0 IN( @ DUP IN> ! ! ;
( Initializes the readln subsystem )
: (c<$)
H@ IN( !
INBUFSZ ALLOT
H@ IN) !
( We need two extra bytes. 1 for the last typed 0x0a and
one for the following NULL. )
2 ALLOT
(infl)
;
( handle backspace: go back one char in IN>, if possible, then
emit SPC + BS )
: (inbs)
@ -73,10 +62,23 @@
;
( And finally, implement a replacement for the (c<) routine )
: (c<)
: (rdln<)
IN> @ C@ ( c )
( not EOL? good, inc and return )
DUP IF 1 IN> +! EXIT THEN ( c )
( EOL ? readline. we still return typed char though )
(rdln) ( c )
;
( Initializes the readln subsystem )
: (c<$)
H@ IN( !
INBUFSZ ALLOT
H@ IN) !
( We need two extra bytes. 1 for the last typed 0x0a and
one for the following NULL. )
2 ALLOT
(infl)
['] (rdln<) 0x0c RAM+ !
;