aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgermeier <germeier>2003-07-15 07:34:52 +0000
committergermeier <germeier>2003-07-15 07:34:52 +0000
commit170e9880d8b7321eab663ce56e7874ed7f835f56 (patch)
tree245649ade8c5d8dd879b9698abe55a830479d3d8
parenteb0f0a90a2b2f763bf4682f0565a082439485b85 (diff)
downloadmpiosh-170e9880d8b7321eab663ce56e7874ed7f835f56.tar.gz
mpiosh-170e9880d8b7321eab663ce56e7874ed7f835f56.tar.bz2
mpiosh-170e9880d8b7321eab663ce56e7874ed7f835f56.zip
follow up fix for the broken internal FAT fix
added FTYPE_BROKEN
-rw-r--r--ChangeLog5
-rw-r--r--libmpio/defs.h4
-rw-r--r--libmpio/src/directory.c10
3 files changed, 16 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index b2f1a8e..77e4f42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-07-15 Markus Germeier <mager@tzi.de>
+ * libmpio/src/directory.c (mpio_dentry_get_real):
+ follow up fix for the broken internal FAT fix
+ added FTYPE_BROKEN
+
2003-07-14 Markus Germeier <mager@tzi.de>
* libmpio/src/directory.c (mpio_dentry_get_startcluster):
fixed a bug Yury stumbled across
diff --git a/libmpio/defs.h b/libmpio/defs.h
index dd3cd09..413ab6a 100644
--- a/libmpio/defs.h
+++ b/libmpio/defs.h
@@ -1,5 +1,5 @@
/*
- * $Id: defs.h,v 1.27 2003/06/26 19:53:58 germeier Exp $
+ * $Id: defs.h,v 1.28 2003/07/15 07:34:53 germeier Exp $
*
* libmpio - a library for accessing Digit@lways MPIO players
* Copyright (C) 2002, 2003 Markus Germeier
@@ -72,6 +72,8 @@ typedef enum { FTYPE_CHAN = 0x00,
FTYPE_WAV = 'V',
FTYPE_ENTRY = 'R',
FTYPE_DIR = 'D',
+ FTYPE_BROKEN = 'X', /* internal "dummy" type, used when
+ internal FAT is broken */
FTYPE_PLAIN = '-'} mpio_filetype_t;
/* fixed filenames */
diff --git a/libmpio/src/directory.c b/libmpio/src/directory.c
index bb19518..7240c14 100644
--- a/libmpio/src/directory.c
+++ b/libmpio/src/directory.c
@@ -1,5 +1,5 @@
/*
- * $Id: directory.c,v 1.9 2003/07/14 21:29:09 germeier Exp $
+ * $Id: directory.c,v 1.10 2003/07/15 07:34:53 germeier Exp $
*
* libmpio - a library for accessing Digit@lways MPIO players
* Copyright (C) 2002, 2003 Markus Germeier
@@ -804,7 +804,13 @@ mpio_dentry_get_real(mpio_t *m, mpio_mem_t mem, BYTE *buffer,
*type = FTYPE_PLAIN;
if (mem == MPIO_INTERNAL_MEM) {
f = mpio_dentry_get_startcluster(m, mem, buffer);
- *type = m->internal.fat[f->entry * 0x10 + 0x06];
+ if (f) {
+ *type = m->internal.fat[f->entry * 0x10 + 0x06];
+ } else {
+ /* we did not find the startcluster, thus the internal
+ FAT is broken for this file */
+ *type = FTYPE_BROKEN;
+ }
}
}