summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2016-10-18 16:10:07 +0000
committerChristos Zoulas <christos@zoulas.com>2016-10-18 16:10:07 +0000
commitf0aca10faf16407b97b72b63091ef0d0ea86c1e8 (patch)
treed3223873c20962ddaad76059c2fa10db43da0913
parentb2f8473874e3396d0db231936929706b2e834d9a (diff)
downloadfile-git-f0aca10faf16407b97b72b63091ef0d0ea86c1e8.tar.gz
instead of requiring all the sections to be present, require only one of them.
-rw-r--r--src/readcdf.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/readcdf.c b/src/readcdf.c
index 1b105d06..483e1d80 100644
--- a/src/readcdf.c
+++ b/src/readcdf.c
@@ -26,7 +26,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: readcdf.c,v 1.61 2016/10/17 23:04:27 christos Exp $")
+FILE_RCSID("@(#)$File: readcdf.c,v 1.62 2016/10/18 16:10:07 christos Exp $")
#endif
#include <assert.h>
@@ -514,15 +514,13 @@ cdf_file_dir_info(struct magic_set *ms, const cdf_dir_t *dir)
const struct sinfo *si = &sectioninfo[sd];
for (j = 0; si->sections[j]; j++) {
if (cdf_find_stream(dir, si->sections[j], si->types[j])
- <= 0) {
+ > 0)
+ break;
#ifdef CDF_DEBUG
- fprintf(stderr, "Can't read %s\n",
- si->sections[j]);
+ fprintf(stderr, "Can't read %s\n", si->sections[j]);
#endif
- break;
- }
}
- if (si->sections[j] != NULL)
+ if (si->sections[j] == NULL)
continue;
if (NOTMIME(ms)) {
if (file_printf(ms, "CDFV2 %s", si->name) == -1)