From 358c50662fef0e6231700e8ecb27ca66f5b5bad9 Mon Sep 17 00:00:00 2001 From: April Ayres-Griffiths Date: Wed, 20 Jun 2018 15:58:25 +1000 Subject: [PATCH] system and extension chunking fixes --- shell.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/shell.go b/shell.go index 84d1419..e294175 100644 --- a/shell.go +++ b/shell.go @@ -1105,7 +1105,9 @@ func shellPut(args []string) int { addrStr := m[0][2] addr, _ = strconv.ParseInt(addrStr, 0, 32) } else { - name = strings.Replace(name, "."+ext, "", -1) + //name = strings.Replace(name, "."+ext, "", -1) + l := len(ext) + 1 + name = name[:len(name)-l] } kind = disk.AppleDOSFileTypeFromExt(ext) @@ -1143,11 +1145,18 @@ func shellPut(args []string) int { addrStr := m[0][2] addr, _ = strconv.ParseInt(addrStr, 0, 32) } else { - name = strings.Replace(name, "."+ext, "", -1) + l := len(ext) + 1 + name = name[:len(name)-l] } kind := disk.ProDOSFileTypeFromExt(ext) + if strings.ToLower(ext) == "system" { + name += "." + ext + ext = "" + kind = disk.ProDOSFileTypeFromExt("SYS") + } + if strings.HasSuffix(args[0], ".INT.ASC") { kind = disk.FileType_PD_INT } else if strings.HasSuffix(args[0], ".APP.ASC") {