diff options
author | Daniel Macks <dmacks@netspace.org> | 2014-11-12 07:42:27 -0800 |
---|---|---|
committer | Dan Nicholson <dbn.lists@gmail.com> | 2014-11-12 07:45:19 -0800 |
commit | a4ef3552eb6877243cdc5b16cbbc2201047c7973 (patch) | |
tree | f90e8e9692249f8000dd4696b9e1cce7ec3a666b | |
parent | 0e847a2201ace5e53e474c52ad5b51e70607980e (diff) | |
download | pkg-config-a4ef3552eb6877243cdc5b16cbbc2201047c7973.tar.gz |
Bump scanned_dir_count even if dir cannot be read
This allows the --debug output to follow the actual order of the
directories specified in the path.
$ PKG_CONFIG_PATH=/nosuch1:/nosuch2:/dir-with-foo.pc
$ pkg-config --debug foo
[...]
Path position of 'foo' is 1
With this change, the path position above would be 3, matching the
position in PKG_CONFIG_PATH.
Freedesktop #80380 (https://bugs.freedesktop.org/show_bug.cgi?id=80380)
-rw-r--r-- | pkg.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -160,16 +160,17 @@ scan_dir (char *dirname) #endif dir = opendir (dirname_copy); g_free (dirname_copy); + + scanned_dir_count += 1; + if (!dir) { - debug_spew ("Cannot open directory '%s' in package search path: %s\n", - dirname, g_strerror (errno)); + debug_spew ("Cannot open directory #%i '%s' in package search path: %s\n", + scanned_dir_count, dirname, g_strerror (errno)); return; } - debug_spew ("Scanning directory '%s'\n", dirname); - - scanned_dir_count += 1; + debug_spew ("Scanning directory #%i '%s'\n", scanned_dir_count, dirname); while ((dent = readdir (dir))) { |