]> git.sur5r.net Git - cc65/commitdiff
Patch by groepaz to fix the problem that DEL files would appear as type DIR.
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 7 Apr 2011 20:58:03 +0000 (20:58 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 7 Apr 2011 20:58:03 +0000 (20:58 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4983 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/cbm/cbm_dir.c

index be044b844cd7d14b37883e2ff7d3ff03bc79a78d..e27813d25b523f3c5e18a472a7e93895074a4c99 100644 (file)
@@ -13,7 +13,7 @@
 
 
 
-unsigned char __fastcall__ cbm_opendir (unsigned char lfn, unsigned char device) 
+unsigned char __fastcall__ cbm_opendir (unsigned char lfn, unsigned char device)
 {
     unsigned char status;
     if ((status = cbm_open (lfn, device, CBM_READ, "$")) == 0) {
@@ -42,7 +42,7 @@ unsigned char __fastcall__ cbm_readdir (unsigned char lfn, register struct cbm_d
     unsigned char rv;
     unsigned char is_header;
     static const unsigned char types[] = {
-        CBM_T_OTHER, CBM_T_OTHER, CBM_T_CBM,   CBM_T_DIR,   /* a b c d */
+        CBM_T_OTHER, CBM_T_OTHER, CBM_T_CBM,   CBM_T_DEL,   /* a b c d */
         CBM_T_OTHER, CBM_T_OTHER, CBM_T_OTHER, CBM_T_OTHER, /* e f g h */
         CBM_T_OTHER, CBM_T_OTHER, CBM_T_OTHER, CBM_T_OTHER, /* i j k l */
         CBM_T_OTHER, CBM_T_OTHER, CBM_T_OTHER, CBM_T_PRG,   /* m n o p */
@@ -120,7 +120,9 @@ unsigned char __fastcall__ cbm_readdir (unsigned char lfn, register struct cbm_d
                     l_dirent->type = CBM_T_OTHER;
                 }
 
-                cbm_k_basin();
+                if ((cbm_k_basin() == 'i') && (l_dirent->type == CBM_T_DEL)) {
+                    l_dirent->type = CBM_T_DIR;
+                }
                 cbm_k_basin();
 
                 byte = cbm_k_basin();