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

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

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39862 3c298f89-4303-0410-b956-a3cf2f4a3e73

--- a/scripts/config/zconf.l
+++ b/scripts/config/zconf.l
@@ -345,6 +345,13 @@
 	int i;
 
 	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) {
 		const char *reason = "unknown error";
 

--- a/scripts/config/zconf.lex.c_shipped
+++ b/scripts/config/zconf.lex.c_shipped
@@ -2401,6 +2401,13 @@
 	int i;
 
 	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) {
 		const char *reason = "unknown error";
 

comments