ref: 71cc81f4454b5bc72bc59e26a50fc64ed4dca348
parent: b5899962711cfafcf9557a0f78c77a525a15afa8
author: qwx <qwx@sciops.net>
date: Sun Mar 5 18:05:19 EST 2023
remove ft2-clone-dirread: pushed to fork
--- a/ft2-clone-dirread
+++ /dev/null
@@ -1,97 +1,0 @@
-diff fde50d93b2284178743a12e8c359286ea99f0b21 uncommitted
---- a/src/ft2_diskop.c
-+++ b/src/ft2_diskop.c
-@@ -1565,14 +1565,15 @@
- {
- DirRec *dirEntry = &FReq_Buffer[rad];
-
-- char *name = unicharToCp437(dirEntry->nameU, true);
-- if (name == NULL)
-- return NULL;
-+ //char *name = unicharToCp437(dirEntry->nameU, true);
-+ //if (name == NULL)
-+ // return NULL;
-+ char *name = dirEntry->nameU;
-
- const int32_t nameLen = (int32_t)strlen(name);
- if (nameLen == 0)
- {
-- free(name);
-+ //free(name);
- return NULL;
- }
-
-@@ -1579,7 +1580,7 @@
- char *p = (char *)malloc(nameLen+1+1);
- if (p == NULL)
- {
-- free(name);
-+ //free(name);
- return NULL;
- }
-
-@@ -1594,7 +1595,7 @@
-
- strcpy(&p[1], name);
-
-- free(name);
-+ //free(name);
- return p;
- }
- else
-@@ -1606,7 +1607,7 @@
- {
- // sort by filename
- strcpy(p, name);
-- free(name);
-+ //free(name);
- return p;
- }
- else
-@@ -1616,7 +1617,7 @@
- if (extLen <= 1)
- {
- strcpy(p, name);
-- free(name);
-+ //free(name);
- return p;
- }
-
-@@ -1625,12 +1626,27 @@
- memcpy(&p[extLen-1], name, i);
- p[nameLen-1] = '\0';
-
-- free(name);
-+ //free(name);
- return p;
- }
- }
- }
-
-+static int dcmp(void *a, void *b)
-+{
-+ DirRec *d, *e;
-+ char *n, *m;
-+
-+ // FIXME: reimplement dcmp with the stuff the rest does
-+ d = a;
-+ e = b;
-+ //n = d->nameU;//unicharToCp437(d->nameU, true);
-+ //m = e->nameU;//unicharToCp437(e->nameU, true);
-+ n = ach(d - FReq_Buffer);
-+ m = ach(e - FReq_Buffer);
-+ return _stricmp(n, m);
-+}
-+
- static void sortDirectory(void)
- {
- bool didSwap;
-@@ -1637,6 +1653,8 @@
-
- if (FReq_FileCount < 2)
- return; // no need to sort
-+ qsort(FReq_Buffer, FReq_FileCount, sizeof *FReq_Buffer, dcmp);
-+ return;
-
- uint32_t offset = FReq_FileCount >> 1;
- while (offset > 0)