Fix newly-introduced wildcard bug.

This commit is contained in:
Bobbi Webber-Manners 2021-09-11 20:14:58 -04:00
parent f62b832228
commit aa379249a6
3 changed files with 6 additions and 6 deletions

Binary file not shown.

View File

@ -711,7 +711,7 @@ INFO JSR PREPATH ; Preprocess pathname
** it does not go well ;)
INFOREENTRY
JSR WILDNEXT
JSR WILDNEXT ; Start of new block
BCS INFOEXIT ; No more matches
INFOFIRST LDA WILDIDX
CMP #$FF ; Is WILDNEXT about to read new blk?

View File

@ -56,6 +56,7 @@ WILDCARD STZ :LAST
* Obtain subsequent wildcard matches
* WILDCARD must have been called first
* Returns with carry set if wildcard match fails, clear otherwise
* Caller should check WILDIDX and call again if value is $FF
WILDNEXT LDX MFTEMP ; Length of MFTEMP
:L1 CPX #$00 ; Find final segment (previous match)
BEQ :S1
@ -73,10 +74,7 @@ WILDNEXT LDX MFTEMP ; Length of MFTEMP
JSR TMPtoMF ; Copy back to MOSFILE
CLC
RTS
:NOMATCH LDA WILDIDX ; See if there are more blocks
CMP #$FF
BEQ :S1 ; Yes, go again
SEC
:NOMATCH SEC
RTS
* Copy a segment of the path into SEGBUF
@ -163,7 +161,7 @@ WILDIDX DB $00 ; Dirent idx in current block
* Read directory block, apply wildcard match
* Inputs: directory name in XY (Pascal string)
* If there is a match, replaces SEGBUF with the first match and CLC
* If there is a match, carry clear
* If no match, or any other error, returns with carry set
* Leaves the directory open to allow resumption of search.
SRCHBLK LDA WILDIDX
@ -192,6 +190,8 @@ SRCHBLK LDA WILDIDX
:CONT JSR SRCHBLK2 ; Handle one block
BCS :MATCH
SEC
RTS
:MATCH CLC
RTS