Skip to content

Commit

Permalink
Merge pull request syslog-ng#5082 from HofiOne/fix-handling-of-glob-r…
Browse files Browse the repository at this point in the history
…eturn-values-on-musl

cfg-lexer: fix handling of glob return values on musl
  • Loading branch information
HofiOne authored Sep 4, 2024
2 parents 1f2650c + 88a324d commit d67de1b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/cfg-lexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,9 +628,7 @@ cfg_lexer_include_file_glob_at(CfgLexer *self, CfgIncludeLevel *level, const gch

r = glob(pattern, GLOB_NOMAGIC, _cfg_lexer_glob_err, &globbuf);

if (r == 0 && globbuf.gl_pathc == 0)
r = GLOB_NOMATCH;
if (r != 0)
if (r != 0 || globbuf.gl_pathc == 0)
{
globfree(&globbuf);
if (r == GLOB_NOMATCH)
Expand All @@ -642,9 +640,8 @@ cfg_lexer_include_file_glob_at(CfgLexer *self, CfgIncludeLevel *level, const gch
return TRUE;
}
#endif
return FALSE;
}
return TRUE;
return FALSE;
}

for (i = 0; i < globbuf.gl_pathc; i++)
Expand Down

0 comments on commit d67de1b

Please sign in to comment.