diff --git a/libpkgconf/pkg.c b/libpkgconf/pkg.c index 89f13c5..e2007f7 100644 --- a/libpkgconf/pkg.c +++ b/libpkgconf/pkg.c @@ -452,7 +452,9 @@ pkgconf_pkg_scan_dir(pkgconf_client_t *client, const char *path, void *data, pkg pkgconf_strlcat(filebuf, "/", sizeof filebuf); pkgconf_strlcat(filebuf, dirent->d_name, sizeof filebuf); - stat(filebuf, &st); + if (stat(filebuf, &st) == -1) + continue; + if (!(S_ISREG(st.st_mode))) continue;