From 55b56b24751411a79d2ea52ca9693cd208ebf459 Mon Sep 17 00:00:00 2001 From: uz Date: Sun, 5 Aug 2012 21:32:40 +0000 Subject: [PATCH] Fixed a bug: The floppies do not like ,R (for read mode) when opening the directory. git-svn-id: svn://svn.cc65.org/cc65/trunk@5804 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/cbm/open.s | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libsrc/cbm/open.s b/libsrc/cbm/open.s index dadf82d33..678dd0441 100644 --- a/libsrc/cbm/open.s +++ b/libsrc/cbm/open.s @@ -96,7 +96,7 @@ parmok: jsr popax ; Get flags ; Invalid open mode - lda #EINVAL +einval: lda #EINVAL ; Error entry. Sets _errno, clears _oserror, returns -1 @@ -119,11 +119,14 @@ closeandexit: oserror:jmp __mappederrno + ; Read bit is set. Add an 'r' to the name -doread: lda #'r' +doread: ldy fnisfile ; File or directory? + beq isdir ; Don't add ,R for directory + lda #'r' jsr fnaddmode ; Add the mode to the name - lda #LFN_READ +isdir: lda #LFN_READ bne common ; Branch always ; If O_TRUNC is set, scratch the file, but ignore any errors @@ -199,4 +202,4 @@ nofile: ; ... else use SA=0 (read) .endproc - + -- 2.39.5