Fix bug with *INFO on filename without wildcard.

This commit is contained in:
Bobbi Webber-Manners 2021-09-12 02:05:17 -04:00
parent a18eeeabae
commit 052e46f98a
19 changed files with 538 additions and 492 deletions

Binary file not shown.

View File

@ -194,3 +194,5 @@ MAINZP MAC

View File

@ -468,3 +468,5 @@ OSWORDM ASC 'OSWORD($'
OSBM2 ASC ').'
DB $00

View File

@ -448,3 +448,5 @@ BYTE76 LDX #$00 ; Update LEDs and return X=SHIFT

View File

@ -926,3 +926,5 @@ ERROR2E DW $C800

View File

@ -180,3 +180,5 @@ BYTE00A BRK
HELLO ASC 'Applecorn MOS 2021-09-11 snapshot'
DB $00 ; Unify MOS messages

View File

@ -496,3 +496,5 @@ AUXBLK ASC '**ENDOFCODE**'

View File

@ -66,3 +66,5 @@ OSFILECB EQU $2EE ; OSFILE control block
* $0300-$03DF
* $03E0-$03FF Used for interfacing with ProDOS XFER

View File

@ -524,3 +524,5 @@ ECHOLP1 JSR GSREAD
* PLA
* JSR OUTHEX
* JMP OSNEWL

View File

@ -619,3 +619,5 @@ BYTEA0 LDY #79 ; Read VDU variable $09,$0A
LDX #23
RTS
* TEST

View File

@ -58,3 +58,5 @@ GEOFCMD EQU $D1

View File

@ -104,3 +104,5 @@ RESET TSX

View File

@ -130,6 +130,8 @@ CANTOPEN ASC "Unable to open ROM file"

View File

@ -108,3 +108,5 @@ QUITPL HEX 04 ; Number of parameters

View File

@ -136,6 +136,8 @@ ROM8 STR "USERROM2.ROM"

View File

@ -157,3 +157,5 @@ FILEREFS DB $00,$00,$00,$00

View File

@ -284,3 +284,5 @@ PREFIX DS 65 ; Buffer for ProDOS prefix

View File

@ -701,6 +701,7 @@ CATARG DB $00
* Handle *INFO
INFO JSR PREPATH ; Preprocess pathname
SEC
JSR WILDCARD ; Handle any wildcards
JSR EXISTS ; Check matches something
CMP #$00
@ -708,10 +709,6 @@ INFO JSR PREPATH ; Preprocess pathname
LDA #$46 ; Not found (TO DO: err code?)
BRA CATEXIT
** BUG: If the last segment is a literal with no wildcard, then
** the directory block is never loaded into memory, so printing
** it does not go well ;)
INFOREENTRY
JSR WILDNEXT2 ; Start of new block
BCS INFOEXIT ; No more matches
@ -778,6 +775,7 @@ DRVINFO >>> ENTMAIN
SETPERM >>> ENTMAIN
JSR PREPATH ; Preprocess pathname
BCS :SYNERR
CLC
JSR WILDCARD ; Handle any wildcards
BCS :NONE
STZ :LFLAG
@ -844,6 +842,7 @@ SETPERM >>> ENTMAIN
MULTIDEL >>> ENTMAIN
JSR PREPATH ; Preprocess pathname
BCS :SYNERR
CLC
JSR WILDCARD ; Handle any wildcards
BCS :NONE
BRA :MAINLOOP
@ -881,3 +880,5 @@ MAINRDMEM STA A1L
LDA (A1L)
MAINRDEXIT >>> XF2AUX,NULLRTS ; Back to an RTS

View File

@ -5,7 +5,8 @@
* Performs wildcard matching for operations that only require the
* first match. <*obj-spec*> in Acorn ADFS terminology.
WILDONE JSR WILDCARD
WILDONE CLC
JSR WILDCARD
JSR CLSDIR
RTS
@ -13,8 +14,13 @@ WILDONE JSR WILDCARD
* by '/'), and for each segment see if it contains wildcard chars.
* If so, pass it to SRCHBLK to expand the wildcard. If not, just
* append the segment as it is. Uses MFTEMP to build up the path.
* On entry: SEC to force leaf noden lookup even if no wildcard,
* CLC otherwise
* Returns with carry set if wildcard match fails, clear otherwise
WILDCARD STZ :LAST
WILDCARD STZ :ALWAYS ; Set :ALWAYS if carry set
BCC :NORMAL
DEC :ALWAYS
:NORMAL STZ :LAST
LDX #$00 ; Start with first char
STX MFTEMP ; Clear MFTEMP (len=0)
PHX
@ -32,7 +38,11 @@ WILDCARD STZ :LAST
BEQ :L1 ; ... go again
:S1 JSR HASWILD ; See if it has '*'/'#'/'?'
BCS :WILD ; It does
JSR APPSEG ; Not wild: Append SEGBUF to MFTEMP
LDA :ALWAYS ; Always do leaf-node lookup?
BEQ :S2
LDA :LAST ; If it is the last segment do ..
BNE :WILD ; .. wildcard lookup anyhow (for *INFO)
:S2 JSR APPSEG ; Not wild: Append SEGBUF to MFTEMP
BRA :NEXT
:WILD LDX #<MFTEMP ; Invoke SRCHBLK to look for pattern
LDY #>MFTEMP ; in the directory path MFTEMP
@ -52,6 +62,7 @@ WILDCARD STZ :LAST
SEC
RTS
:LAST DB $00 ; Flag for last segment
:ALWAYS DB $00 ; Flag to always lookup leafnode
* Obtain subsequent wildcard matches
* WILDCARD must have been called first
@ -369,3 +380,5 @@ MATCHBUF DS 65 ; For storing match results (Pascal str)