Skip to content

Commit a7869ba

Browse files
authored
Merge pull request #261 from bazsi/glob-error-handling
cfg-lexer: fix handling of glob return values on musl
2 parents d8c6ba0 + b537b11 commit a7869ba

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/cfg-lexer.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -686,9 +686,7 @@ cfg_lexer_include_file_glob_at(CfgLexer *self, CfgIncludeLevel *level, const gch
686686

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

689-
if (r == 0 && globbuf.gl_pathc == 0)
690-
r = GLOB_NOMATCH;
691-
if (r != 0)
689+
if (r != 0 || globbuf.gl_pathc == 0)
692690
{
693691
globfree(&globbuf);
694692
if (r == GLOB_NOMATCH)
@@ -700,9 +698,8 @@ cfg_lexer_include_file_glob_at(CfgLexer *self, CfgIncludeLevel *level, const gch
700698
return TRUE;
701699
}
702700
#endif
703-
return FALSE;
704701
}
705-
return TRUE;
702+
return FALSE;
706703
}
707704

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

0 commit comments

Comments
 (0)