Fix for f->d_type always being DT_UNKNOWN, using stat().
This commit is contained in:
parent
ab87c3ec22
commit
51df37c21c
1 changed files with 4 additions and 3 deletions
|
|
@ -16563,10 +16563,11 @@ void load_magic_plugins(void)
|
||||||
|
|
||||||
if (f != NULL)
|
if (f != NULL)
|
||||||
{
|
{
|
||||||
if (f->d_type == DT_REG)
|
struct stat sbuf;
|
||||||
{
|
|
||||||
snprintf(fname, sizeof(fname), "%s%s", place, f->d_name);
|
|
||||||
|
|
||||||
|
snprintf(fname, sizeof(fname), "%s%s", place, f->d_name);
|
||||||
|
if (!stat(fname, &sbuf) && S_ISREG(sbuf.st_mode))
|
||||||
|
{
|
||||||
/* Get just the name of the object (e.g., "negative"), w/o filename
|
/* Get just the name of the object (e.g., "negative"), w/o filename
|
||||||
extension: */
|
extension: */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue