VE: fix buffer overflow with 'f' and make 'H' and 'L' affect 'f'

This commit is contained in:
Virgil Dupras 2020-06-06 21:59:22 -04:00
parent b22ab8437b
commit c6016cd429
2 changed files with 3 additions and 3 deletions

View File

@ -10,5 +10,5 @@
: $E E contents ;
: $X acc@ X contents ;
: $h -1 cmv ; : $l 1 cmv ; : $k -64 cmv ; : $j 64 cmv ;
: $H 0acc EDPOS @ 0x3c0 AND EDPOS ! ;
: $L 0acc EDPOS @ 0x3f OR EDPOS ! ;
: $H 0acc EDPOS @ 0x3c0 AND pos! ;
: $L 0acc EDPOS @ 0x3f OR pos! ;

View File

@ -1,6 +1,6 @@
: $f EDPOS @ PREVPOS @ 2DUP = IF 2DROP EXIT THEN
2DUP > IF DUP pos! SWAP THEN
( p1 p2, p1 < p2 ) OVER - ( pos len ) FBUF _zbuf
( p1 p2, p1 < p2 ) OVER - 64 MIN ( pos len ) FBUF _zbuf
SWAP _cpos FBUF ( len src dst ) ROT MOVE ;
: $R ( replace mode )
mode! 'R' EMIT