diff options
author | Michal Domonkos <mdomonko@redhat.com> | 2022-07-29 14:41:03 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2022-08-18 12:33:00 +0300 |
commit | 493dd91bc1bb8cdce6a75bfa65175f6e148c9dc5 (patch) | |
tree | a0ef90136283fb3b2b163200323cea33f80256d3 /rpmio/rpmglob.c | |
parent | ecc140c42f551b8d99d89e600cb10d098d18e3e2 (diff) | |
download | rpm-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.c | 2 |
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 |