scripts/config: make wildcard include with no results non-fatal

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 39862
This commit is contained in:
Felix Fietkau 2014-03-10 18:58:40 +00:00
parent 5ef90f6540
commit 81013f6bbe
2 changed files with 14 additions and 0 deletions

View file

@ -345,6 +345,13 @@ void zconf_nextfile(const char *name)
int i; int i;
err = glob(name, GLOB_ERR | GLOB_MARK, NULL, &gl); err = glob(name, GLOB_ERR | GLOB_MARK, NULL, &gl);
/* ignore wildcard patterns that return no result */
if (err == GLOB_NOMATCH && strchr(name, '*')) {
err = 0;
gl.gl_pathc = 0;
}
if (err) { if (err) {
const char *reason = "unknown error"; const char *reason = "unknown error";

View file

@ -2401,6 +2401,13 @@ void zconf_nextfile(const char *name)
int i; int i;
err = glob(name, GLOB_ERR | GLOB_MARK, NULL, &gl); err = glob(name, GLOB_ERR | GLOB_MARK, NULL, &gl);
/* ignore wildcard patterns that return no result */
if (err == GLOB_NOMATCH && strchr(name, '*')) {
err = 0;
gl.gl_pathc = 0;
}
if (err) { if (err) {
const char *reason = "unknown error"; const char *reason = "unknown error";