mirror of
https://github.com/irmen/prog8.git
synced 2024-11-26 11:49:22 +00:00
remove no longer needed strlen() calls from diskio routines
This commit is contained in:
parent
bf69219f98
commit
975af4764d
@ -424,10 +424,9 @@ io_error:
|
||||
|
||||
sub delete(ubyte drivenumber, uword filenameptr) {
|
||||
; -- delete a file on the drive
|
||||
ubyte flen = string.length(filenameptr)
|
||||
filename[0] = 's'
|
||||
filename[1] = ':'
|
||||
string.copy(filenameptr, &filename+2)
|
||||
ubyte flen = string.copy(filenameptr, &filename+2)
|
||||
c64.SETNAM(flen+2, filename)
|
||||
c64.SETLFS(1, drivenumber, 15)
|
||||
void c64.OPEN()
|
||||
@ -437,13 +436,11 @@ io_error:
|
||||
|
||||
sub rename(ubyte drivenumber, uword oldfileptr, uword newfileptr) {
|
||||
; -- rename a file on the drive
|
||||
ubyte flen_old = string.length(oldfileptr)
|
||||
ubyte flen_new = string.length(newfileptr)
|
||||
filename[0] = 'r'
|
||||
filename[1] = ':'
|
||||
string.copy(newfileptr, &filename+2)
|
||||
ubyte flen_new = string.copy(newfileptr, &filename+2)
|
||||
filename[flen_new+2] = '='
|
||||
string.copy(oldfileptr, &filename+3+flen_new)
|
||||
ubyte flen_old = string.copy(oldfileptr, &filename+3+flen_new)
|
||||
c64.SETNAM(3+flen_new+flen_old, filename)
|
||||
c64.SETLFS(1, drivenumber, 15)
|
||||
void c64.OPEN()
|
||||
|
@ -16,5 +16,7 @@ main {
|
||||
diskio.directory(8)
|
||||
diskio.delete(8, "newname")
|
||||
diskio.directory(8)
|
||||
|
||||
txt.print("---------------------------------\n")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user