printing (i.e. we are doing mime or something else), set the return value,
so that we stop searching. This avoids the issue where mime matched later
entries in the magic list, instead of matching nothing (entries with no
mime that would have matched earlier).
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.272 2018/10/19 00:33:04 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.273 2018/10/23 18:34:46 christos Exp $")
#endif /* lint */
#include "magic.h"
return e;
}
+ if (*m->desc)
+ *returnval = 1;
/*
* If we are going to print something, we'll need to print
* a blank before we print something else.
*returnval = 1;
return e;
}
+ if (*m->desc)
+ *returnval = 1;
if (print && *m->desc) {
/*
* This continuation matched. Print
firstline = 0;
*returnval = 1;
}
- if ((ms->flags & MAGIC_CONTINUE) == 0 && *printed_something) {
+ if ((ms->flags & MAGIC_CONTINUE) == 0 && *returnval) {
return *returnval; /* don't keep searching */
}
cont_level = 0;