popt/popt-1.16-glob-error.patch
Troy Dawson 8e5a0313a5 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/popt#b7599d5d03e76f94f7734d9b0761ff66ec4400b4
2020-10-14 16:26:30 -07:00

25 lines
701 B
Diff

Backport of upstream http://rpm5.org/cvs/chngview?cn=19258
--- popt-1.16/poptconfig.c 2009-05-20 15:18:07.000000000 +0200
+++ popt-1.16/poptconfig.c.glob-error 2017-10-12 23:33:28.868435647 +0200
@@ -108,7 +108,7 @@
if (glob_pattern_p(pat, 0)) {
glob_t _g, *pglob = &_g;
- if (!glob(pat, poptGlobFlags, poptGlob_error, pglob)) {
+ if (!(rc = glob(pat, poptGlobFlags, poptGlob_error, pglob))) {
if (acp) {
*acp = (int) pglob->gl_pathc;
pglob->gl_pathc = 0;
@@ -122,6 +122,10 @@
/*@-nullstate@*/
globfree(pglob);
/*@=nullstate@*/
+ } else if (rc == GLOB_NOMATCH) {
+ *avp = NULL;
+ *acp = 0;
+ rc = 0;
} else
rc = POPT_ERROR_ERRNO;
} else