mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2026-01-08 23:10:13 +01:00
Only treat real files (or symlinks to real files) as .pc files
Ignore any dangling symlinks. Thanks to Ciaran Anscomb for patch inspiration. Fixes Freedesktop #23922
This commit is contained in:
parent
beb55100ea
commit
b02c40bca4
1 changed files with 11 additions and 7 deletions
18
pkg.c
18
pkg.c
|
|
@ -203,13 +203,17 @@ scan_dir (const char *dirname)
|
|||
filename[dirnamelen] = G_DIR_SEPARATOR;
|
||||
strcpy (filename + dirnamelen + 1, dent->d_name);
|
||||
|
||||
g_hash_table_insert (locations, pkgname, filename);
|
||||
g_hash_table_insert (path_positions, pkgname,
|
||||
GINT_TO_POINTER (scanned_dir_count));
|
||||
|
||||
debug_spew ("Will find package '%s' in file '%s'\n",
|
||||
pkgname, filename);
|
||||
}
|
||||
if (g_file_test(filename, G_FILE_TEST_IS_REGULAR) == TRUE) {
|
||||
g_hash_table_insert (locations, pkgname, filename);
|
||||
g_hash_table_insert (path_positions, pkgname,
|
||||
GINT_TO_POINTER (scanned_dir_count));
|
||||
debug_spew ("Will find package '%s' in file '%s'\n",
|
||||
pkgname, filename);
|
||||
} else {
|
||||
debug_spew ("Ignoring '%s' while looking for '%s'; not a "
|
||||
"regular file.\n", pkgname, filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue