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;