From 092df9c67268fcc985a2bc3b52617b9394186613 Mon Sep 17 00:00:00 2001 From: Bobbi Webber-Manners Date: Tue, 2 Jun 2020 20:01:21 -0400 Subject: [PATCH] Fixed computation of slot and drive number --- sortdir.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sortdir.c b/sortdir.c index ddea816..d0f518f 100644 --- a/sortdir.c +++ b/sortdir.c @@ -29,6 +29,7 @@ * v0.66 Modified to build sorted blocks on the fly rather than in aux memory. * v0.67 Fixed bug in v0.66 where garbage was written to end of directory. * v0.68 Cleaned up error msgs. + * v0.69 Fixed support for drive number >2. */ //#pragma debug 9 @@ -508,19 +509,19 @@ void fixcase(char *in, char *out, uchar minvers, uchar vers, uchar len) { uint i; uchar idx = 0; if (!(vers & 0x80)) { - for (idx=0; idx> 4; - drive = ((*lastdev & 0x80) >> 7) + (*lastdev & 0x02) + 1; + drive = ((*lastdev & 0x80) >> 7) + ((*lastdev & 0x03) << 1) + 1; printf("[Slot %u, Drive %u]\n", slot, drive); *device = slot + (drive - 1) * 8; dio_hdl = dio_open(*device); // TODO should dio_close on exit @@ -1873,7 +1879,7 @@ void interactive(void) { doverbose = 1; - puts("S O R T D I R v0.68 alpha Use ^ to return to previous question"); + puts("S O R T D I R v0.69 alpha Use ^ to return to previous question"); q1: fputs("\nEnter path (e.g.: /H1) of starting directory> ", stdout);