summaryrefslogtreecommitdiff
path: root/rpmio/rpmglob.c
diff options
context:
space:
mode:
authorMichal Domonkos <mdomonko@redhat.com>2022-07-29 14:41:03 +0200
committerPanu Matilainen <pmatilai@redhat.com>2022-08-18 12:33:00 +0300
commit493dd91bc1bb8cdce6a75bfa65175f6e148c9dc5 (patch)
treea0ef90136283fb3b2b163200323cea33f80256d3 /rpmio/rpmglob.c
parentecc140c42f551b8d99d89e600cb10d098d18e3e2 (diff)
downloadrpm-493dd91bc1bb8cdce6a75bfa65175f6e148c9dc5.tar.gz
Return GLOB_NOMATCH on missing dirs from rpmGlob()
As per GNU glob(3), GLOB_ONLYDIR does not guarantee the matches are in fact directories, that's why we check them with lstat(2). That may lead to the match list being empty even after a successful glob() run (rc == 0), so for consistency, return GLOB_NOMATCH in that case, just like we would for a missing file. No functional change since we don't check for the exact return code in the callers, only whether it's positive or not.
Diffstat (limited to 'rpmio/rpmglob.c')
-rw-r--r--rpmio/rpmglob.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rpmio/rpmglob.c b/rpmio/rpmglob.c
index 690e7f59f..e5098b0bd 100644
--- a/rpmio/rpmglob.c
+++ b/rpmio/rpmglob.c
@@ -120,7 +120,7 @@ exit:
if (argcPtr)
*argcPtr = argc;
if (argc == 0 && rc == 0)
- rc = 1;
+ rc = GLOB_NOMATCH;
#ifdef ENABLE_NLS