ed: don't crash when inserting in 64th char of the line

This commit is contained in:
Virgil Dupras 2020-06-10 20:56:19 -04:00
parent 7cad9ffe40
commit a405f77185
1 changed files with 2 additions and 4 deletions

View File

@ -7,9 +7,7 @@
_rbufsz IBUF _blen 2DUP > IF
TUCK - ( ilen chars-to-move )
SWAP EDPOS @ _cpos 2DUP + ( ctm ilen a a+ilen )
3 PICK MOVE- ( ctm ilen )
NIP ( ilen )
ELSE DROP ( ilen becomes rbuffsize )
THEN
3 PICK MOVE- ( ctm ilen ) NIP ( ilen )
ELSE DROP 1+ ( ilen becomes rbuffsize+1 ) THEN
DUP IBUF EDPOS @ _cpos ROT MOVE ( ilen ) EDPOS +! BLK!! ;
: I IBUF _type _I EDPOS @ 64 / _pln ;