diff --git a/stdio.asm b/stdio.asm index d2f5a79..706c526 100644 --- a/stdio.asm +++ b/stdio.asm @@ -124,52 +124,10 @@ cl3 lda [stream] remove stream from the file list sta [p] lda [stream],Y sta [p],Y -cl3a ldy #FILE_flag if the file was opened by tmpfile then - lda [stream],Y - and #_IOTEMPFILE - beq cl3d - ph4 #nameBuffSize p = malloc(nameBuffSize) - jsl malloc - sta p - stx p+2 - ora p+2 if p == NULL then - bne cl3aa - lda #EOF flag error - sta err - bra cl3d just close the file -cl3aa lda p - sta grPathname grPathname = p - stx grPathname+2 - clc dsPathname = p+2 - adc #2 - bcc cl3b - inx -cl3b sta dsPathname - stx dsPathname+2 - lda #nameBuffSize p->size = nameBuffSize - sta [p] - ldy #FILE_file clRefnum = grRefnum = stream->_file - lda [stream],Y - beq cl3e - sta grRefnum - GetRefInfoGS gr GetRefInfoGS(gr) - bcs cl3c - lda grRefnum OSClose(cl) - sta clRefNum - OSClose cl - DestroyGS ds DestroyGS(ds) -cl3c ph4

size = nameBuffSize + sta [p] + ldy #FILE_file clRefnum = grRefnum = stream->_file + lda [stream],Y + beq cl4 + sta grRefnum + sta clRefNum + GetRefInfoGS gr GetRefInfoGS(gr) + bcs cl3e + OSClose cl OSClose(cl) + DestroyGS ds DestroyGS(ds) +cl3e ph4