Fix a stat on a null when the internal database is used.

This commit is contained in:
Scott MacVicar 2008-10-22 16:34:17 +00:00
parent be09b491da
commit 6978fff657

View File

@ -251,9 +251,12 @@ apprentice_1(struct magic_set *ms, const char *fn, int action,
}
if ((rv = apprentice_map(ms, &magic, &nmagic, fn)) == -1) {
if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "using regular magic file `%s'", fn);
rv = apprentice_load(ms, &magic, &nmagic, fn, action);
if (fn) {
if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "using regular magic file `%s'", fn);
rv = apprentice_load(ms, &magic, &nmagic, fn, action);
}
if (rv != 0)
return -1;
}