Choose another way to fix the issue from r5804: When parsing the directory
name, add a file mask, so the result is "$0:*" or similar. When specified like this, the drive accepts the r/o specifier ",R" so we don't have to complicate the code in open(). git-svn-id: svn://svn.cc65.org/cc65/trunk@5805 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -125,6 +125,15 @@ drivedone:
|
|||||||
stx fnbuf+1
|
stx fnbuf+1
|
||||||
sta fnbuf+0
|
sta fnbuf+0
|
||||||
|
|
||||||
|
; Add the file mask
|
||||||
|
|
||||||
|
lda #':'
|
||||||
|
sta fnbuf+2
|
||||||
|
lda #'*'
|
||||||
|
sta fnbuf+3
|
||||||
|
lda #4
|
||||||
|
sta fnlen
|
||||||
|
|
||||||
; No need to check the name. Length is already 2
|
; No need to check the name. Length is already 2
|
||||||
|
|
||||||
lda #0 ; ok flag
|
lda #0 ; ok flag
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ parmok: jsr popax ; Get flags
|
|||||||
|
|
||||||
; Invalid open mode
|
; Invalid open mode
|
||||||
|
|
||||||
einval: lda #EINVAL
|
lda #EINVAL
|
||||||
|
|
||||||
; Error entry. Sets _errno, clears _oserror, returns -1
|
; Error entry. Sets _errno, clears _oserror, returns -1
|
||||||
|
|
||||||
@@ -119,14 +119,11 @@ closeandexit:
|
|||||||
|
|
||||||
oserror:jmp __mappederrno
|
oserror:jmp __mappederrno
|
||||||
|
|
||||||
|
|
||||||
; Read bit is set. Add an 'r' to the name
|
; Read bit is set. Add an 'r' to the name
|
||||||
|
|
||||||
doread: ldy fnisfile ; File or directory?
|
doread: lda #'r'
|
||||||
beq isdir ; Don't add ,R for directory
|
|
||||||
lda #'r'
|
|
||||||
jsr fnaddmode ; Add the mode to the name
|
jsr fnaddmode ; Add the mode to the name
|
||||||
isdir: lda #LFN_READ
|
lda #LFN_READ
|
||||||
bne common ; Branch always
|
bne common ; Branch always
|
||||||
|
|
||||||
; If O_TRUNC is set, scratch the file, but ignore any errors
|
; If O_TRUNC is set, scratch the file, but ignore any errors
|
||||||
@@ -202,4 +199,4 @@ nofile: ; ... else use SA=0 (read)
|
|||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user