From 07095b7e3bc63a103d00fe9a29f8204e083961b0 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sun, 16 May 2021 21:13:50 +0100 Subject: [PATCH] Fix calculation of drive no. in Atari ST. --- setter/src/atarist/attr.c | 4 ++-- setter/src/atarist/deleted.c | 4 ++-- setter/src/atarist/dirdepth.c | 4 ++-- setter/src/atarist/filename.c | 4 ++-- setter/src/atarist/files.c | 4 ++-- setter/src/atarist/frag.c | 4 ++-- setter/src/atarist/links.c | 4 ++-- setter/src/atarist/perms.c | 4 ++-- setter/src/atarist/time.c | 4 ++-- setter/src/atarist/volume.c | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/setter/src/atarist/attr.c b/setter/src/atarist/attr.c index c9ec64b..69bbe59 100644 --- a/setter/src/atarist/attr.c +++ b/setter/src/atarist/attr.c @@ -34,12 +34,12 @@ Copyright (C) 2011-2021 Natalia Portillo void FileAttributes(const char* path) { - char driveNo = path[0] - '@'; + char driveNo = path[0] - 'A'; short rc, wRc, cRc; short handle; int i; - if(driveNo > 32) driveNo -= 32; + if(driveNo >= 32) driveNo -= 32; Dsetdrv(driveNo); Dsetpath("\\"); diff --git a/setter/src/atarist/deleted.c b/setter/src/atarist/deleted.c index 20fa722..35469ef 100644 --- a/setter/src/atarist/deleted.c +++ b/setter/src/atarist/deleted.c @@ -31,13 +31,13 @@ Copyright (C) 2011-2021 Natalia Portillo void DeleteFiles(const char* path) { - char driveNo = path[0] - '@'; + char driveNo = path[0] - 'A'; unsigned int rc; char filename[9]; short pos; int handle; - if(driveNo > 32) driveNo -= 32; + if(driveNo >= 32) driveNo -= 32; Dsetdrv(driveNo); Dsetpath("\\"); diff --git a/setter/src/atarist/dirdepth.c b/setter/src/atarist/dirdepth.c index b3b66ec..7011bed 100644 --- a/setter/src/atarist/dirdepth.c +++ b/setter/src/atarist/dirdepth.c @@ -32,12 +32,12 @@ Copyright (C) 2011-2021 Natalia Portillo void DirectoryDepth(const char* path) { - char driveNo = path[0] - '@'; + char driveNo = path[0] - 'A'; unsigned int rc; char filename[9]; int pos = 2; - if(driveNo > 32) driveNo -= 32; + if(driveNo >= 32) driveNo -= 32; Dsetdrv(driveNo); Dsetpath("\\"); diff --git a/setter/src/atarist/filename.c b/setter/src/atarist/filename.c index 98734c4..57aae3c 100644 --- a/setter/src/atarist/filename.c +++ b/setter/src/atarist/filename.c @@ -33,13 +33,13 @@ Copyright (C) 2011-2021 Natalia Portillo void Filenames(const char* path) { - char driveNo = path[0] - '@'; + char driveNo = path[0] - 'A'; unsigned int rc, wRc = 0, cRc = 0; int handle; char message[300]; int pos; - if(driveNo > 32) driveNo -= 32; + if(driveNo >= 32) driveNo -= 32; Dsetdrv(driveNo); Dsetpath("\\"); diff --git a/setter/src/atarist/files.c b/setter/src/atarist/files.c index 02203f1..6985c83 100644 --- a/setter/src/atarist/files.c +++ b/setter/src/atarist/files.c @@ -32,14 +32,14 @@ Copyright (C) 2011-2021 Natalia Portillo void MillionFiles(const char* path) { - char driveNo = path[0] - '@'; + char driveNo = path[0] - 'A'; unsigned int rc; char filename[9]; unsigned int pos; int handle; unsigned total; - if(driveNo > 32) driveNo -= 32; + if(driveNo >= 32) driveNo -= 32; Dsetdrv(driveNo); Dsetpath("\\"); diff --git a/setter/src/atarist/frag.c b/setter/src/atarist/frag.c index 51427d4..3ef3e01 100644 --- a/setter/src/atarist/frag.c +++ b/setter/src/atarist/frag.c @@ -40,12 +40,12 @@ void Fragmentation(const char* path, size_t clusterSize) unsigned int threeQuartersCluster = halfCluster + quarterCluster; unsigned int twoAndThreeQuartCluster = threeQuartersCluster + twoCluster; unsigned char* buffer; - char driveNo = path[0] - '@'; + char driveNo = path[0] - 'A'; unsigned int rc, wRc = 0, cRc = 0; int handle; long i; - if(driveNo > 32) driveNo -= 32; + if(driveNo >= 32) driveNo -= 32; Dsetdrv(driveNo); Dsetpath("\\"); diff --git a/setter/src/atarist/links.c b/setter/src/atarist/links.c index 109df24..61de1ae 100644 --- a/setter/src/atarist/links.c +++ b/setter/src/atarist/links.c @@ -39,7 +39,7 @@ void Links(const char* path) long cookie; int rc; FILE* h; - char driveNo = path[0] - '@'; + char driveNo = path[0] - 'A'; long savessp; // Retrieve pointer to cookie jar in Supervisor mode @@ -57,7 +57,7 @@ void Links(const char* path) if(rc == 0) return; - if(driveNo > 32) driveNo -= 32; + if(driveNo >= 32) driveNo -= 32; Dsetdrv(driveNo); Dsetpath("\\"); diff --git a/setter/src/atarist/perms.c b/setter/src/atarist/perms.c index abe0055..c50ed61 100644 --- a/setter/src/atarist/perms.c +++ b/setter/src/atarist/perms.c @@ -41,7 +41,7 @@ void FilePermissions(const char* path) long cookie; int rc, cRc, i; FILE* file; - char driveNo = path[0] - '@'; + char driveNo = path[0] - 'A'; long savessp; // Retrieve pointer to cookie jar in Supervisor mode @@ -59,7 +59,7 @@ void FilePermissions(const char* path) if(rc == 0) return; - if(driveNo > 32) driveNo -= 32; + if(driveNo >= 32) driveNo -= 32; Dsetdrv(driveNo); Dsetpath("\\"); diff --git a/setter/src/atarist/time.c b/setter/src/atarist/time.c index d8a8feb..066bce9 100644 --- a/setter/src/atarist/time.c +++ b/setter/src/atarist/time.c @@ -34,14 +34,14 @@ Copyright (C) 2011-2021 Natalia Portillo void Timestamps(const char* path) { - char driveNo = path[0] - '@'; + char driveNo = path[0] - 'A'; unsigned int rc, wRc = 0, cRc = 0, tRc = 0; int handle; char message[300]; int i; _DOSTIME timestamp; - if(driveNo > 32) driveNo -= 32; + if(driveNo >= 32) driveNo -= 32; Dsetdrv(driveNo); Dsetpath("\\"); diff --git a/setter/src/atarist/volume.c b/setter/src/atarist/volume.c index 485bc89..4fb377d 100644 --- a/setter/src/atarist/volume.c +++ b/setter/src/atarist/volume.c @@ -35,7 +35,7 @@ Copyright (C) 2011-2021 Natalia Portillo void GetVolumeInfo(const char* path, size_t* clusterSize) { - char driveNo = path[0] - '@'; + char driveNo = path[0] - 'A'; _BPB* bpb; _DISKINFO diskInfo; unsigned int rc;