mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2025-01-05 19:29:37 +00:00
Fixed bug in PREPATH (ticket #82)
This commit is contained in:
parent
d3d4017daf
commit
f1c93fb650
BIN
applecorn.po
BIN
applecorn.po
Binary file not shown.
@ -38,31 +38,32 @@ PREPATH LDX MOSFILE ; Length
|
||||
BRA :APPEND
|
||||
:NOTCOLN JSR GETPREF ; Current pfx -> PREFIX
|
||||
:REENTER LDA MOSFILE+1 ; First char of dirname
|
||||
CMP #'.'
|
||||
BEQ :ONEDOT
|
||||
CMP #'@'
|
||||
BEQ :CWD
|
||||
BEQ :CWD ; '@' means current dir
|
||||
CMP #'^'
|
||||
BEQ :CARET
|
||||
BEQ :CARET ; '^' means parent
|
||||
CMP #'/' ; Absolute path
|
||||
BEQ :EXIT ; Nothing to do
|
||||
BRA :APPEND
|
||||
:ONEDOT JSR DEL1CHAR ; Delete the dot
|
||||
LDA MOSFILE ; Is there more?
|
||||
BEQ :APPEND ; Nope - '.' alone
|
||||
LDA MOSFILE+1
|
||||
CMP #'/' ; './'
|
||||
BEQ :CWD2
|
||||
CMP #'.'
|
||||
BNE :APPEND ; Relative path
|
||||
LDA MOSFILE ; Length
|
||||
CMP #$01
|
||||
BEQ :CWD ; '.' on its own
|
||||
LDA MOSFILE+2
|
||||
CMP #'.' ; '..'
|
||||
BNE :EXIT
|
||||
BEQ :DOTDOT
|
||||
CMP #'/' ; './'
|
||||
BEQ :CWD
|
||||
BRA :ERR ; Anything else is invalid
|
||||
:DOTDOT JSR DEL1CHAR ; Delete first char from MOSFILE
|
||||
:CARET JSR PARENT ; Parent dir -> PREFIX
|
||||
:CWD JSR DEL1CHAR ; Delete first char from MOSFILE
|
||||
:CWD2 LDA MOSFILE ; Is there more?
|
||||
BEQ :APPEND ; Nope!
|
||||
LDA MOSFILE ; Is there more?
|
||||
BEQ :APPEND ; Nothing more
|
||||
CMP #$02 ; Len at least two?
|
||||
BCC :ERR ; Nope!
|
||||
LDA MOSFILE+1 ; What is next char?
|
||||
CMP #'/' ; Is it slash?
|
||||
CMP #'/'
|
||||
BNE :ERR ; Nope!
|
||||
JSR DEL1CHAR ; Delete '/' from MOSFILE
|
||||
BRA :REENTER ; Go again!
|
||||
@ -303,5 +304,3 @@ PREFIX DS 65 ; Buffer for ProDOS prefix
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user