diff options
Diffstat (limited to 'poptconfig.c')
-rw-r--r-- | poptconfig.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/poptconfig.c b/poptconfig.c index ea35088..9459382 100644 --- a/poptconfig.c +++ b/poptconfig.c @@ -112,7 +112,7 @@ static int poptGlob(/*@unused@*/ UNUSED(poptContext con), const char * pattern, if (poptGlob_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; @@ -126,6 +126,10 @@ static int poptGlob(/*@unused@*/ UNUSED(poptContext con), const char * pattern, /*@-nullstate@*/ globfree(pglob); /*@=nullstate@*/ + } else if (rc == GLOB_NOMATCH) { + *avp = NULL; + *acp = 0; + rc = 0; } else rc = POPT_ERROR_ERRNO; } else |