mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-25 20:33:13 +00:00
SED: Fix bug with handling of blank input lines.
This commit is contained in:
parent
75ca6300b9
commit
cc3624079f
@ -1,5 +1,3 @@
|
|||||||
NEW
|
|
||||||
AUTO 3,1
|
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
.OP 65C02
|
.OP 65C02
|
||||||
.OR $2000
|
.OR $2000
|
||||||
@ -253,6 +251,9 @@ CS.RUN.OPEN >PUSHYA
|
|||||||
CS.RUN.PRINT >LDYA ZPBufPtr
|
CS.RUN.PRINT >LDYA ZPBufPtr
|
||||||
>STYA ZPPtr1
|
>STYA ZPPtr1
|
||||||
|
|
||||||
|
lda (ZPPtr1) If null first time
|
||||||
|
beq .8
|
||||||
|
|
||||||
.1 lda (ZPPtr1)
|
.1 lda (ZPPtr1)
|
||||||
beq .7 EOL. No match.
|
beq .7 EOL. No match.
|
||||||
|
|
||||||
@ -290,11 +291,12 @@ CS.RUN.PRINT >LDYA ZPBufPtr
|
|||||||
|
|
||||||
* Hit EOL but not end of pattern, return
|
* Hit EOL but not end of pattern, return
|
||||||
.7 jsr CS.RUN.NoMatch
|
.7 jsr CS.RUN.NoMatch
|
||||||
lda #C.CR
|
.8 lda #C.CR
|
||||||
>SYSCALL PutChar
|
>SYSCALL PutChar
|
||||||
lda #C.LF
|
lda #C.LF
|
||||||
>SYSCALL PutChar
|
>SYSCALL PutChar
|
||||||
clc
|
|
||||||
|
.9 clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN.GotMatch phy
|
CS.RUN.GotMatch phy
|
||||||
@ -377,6 +379,3 @@ MSG.CRLF .AZ "\r\n"
|
|||||||
DS.START
|
DS.START
|
||||||
DS.END .ED
|
DS.END .ED
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
MAN
|
|
||||||
SAVE usr/src/bin/sed.s
|
|
||||||
ASM
|
|
||||||
|
Loading…
Reference in New Issue
Block a user