From 46122f558fe0dd884126df70302a60cfc26ae471 Mon Sep 17 00:00:00 2001 From: oliverschmidt Date: Tue, 26 Oct 2010 18:56:39 +0000 Subject: [PATCH] Skip the CBM volume header. --- platform/c128/cfs/cfs-cbm-dir.c | 10 ++++++---- platform/c64/cfs/cfs-cbm-dir.c | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/platform/c128/cfs/cfs-cbm-dir.c b/platform/c128/cfs/cfs-cbm-dir.c index eb327146b..d72f84294 100644 --- a/platform/c128/cfs/cfs-cbm-dir.c +++ b/platform/c128/cfs/cfs-cbm-dir.c @@ -30,7 +30,7 @@ * * Author: Oliver Schmidt * - * $Id: cfs-cbm-dir.c,v 1.1 2010/10/23 13:48:06 oliverschmidt Exp $ + * $Id: cfs-cbm-dir.c,v 1.2 2010/10/26 18:56:39 oliverschmidt Exp $ */ #include @@ -52,9 +52,11 @@ cfs_readdir(struct cfs_dir *p, struct cfs_dirent *e) { struct cbm_dirent dirent; - if(cbm_readdir(12, &dirent)) { - return -1; - } + do { + if(cbm_readdir(12, &dirent)) { + return -1; + } + } while(dirent.type == CBM_T_HEADER); strcpy(e->name, dirent.name); e->size = dirent.size; return 0; diff --git a/platform/c64/cfs/cfs-cbm-dir.c b/platform/c64/cfs/cfs-cbm-dir.c index eb327146b..d72f84294 100644 --- a/platform/c64/cfs/cfs-cbm-dir.c +++ b/platform/c64/cfs/cfs-cbm-dir.c @@ -30,7 +30,7 @@ * * Author: Oliver Schmidt * - * $Id: cfs-cbm-dir.c,v 1.1 2010/10/23 13:48:06 oliverschmidt Exp $ + * $Id: cfs-cbm-dir.c,v 1.2 2010/10/26 18:56:39 oliverschmidt Exp $ */ #include @@ -52,9 +52,11 @@ cfs_readdir(struct cfs_dir *p, struct cfs_dirent *e) { struct cbm_dirent dirent; - if(cbm_readdir(12, &dirent)) { - return -1; - } + do { + if(cbm_readdir(12, &dirent)) { + return -1; + } + } while(dirent.type == CBM_T_HEADER); strcpy(e->name, dirent.name); e->size = dirent.size; return 0;