From 81013f6bbecf5177ae472d01365c066504ccbdb8 Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@openwrt.org>
Date: Mon, 10 Mar 2014 18:58:40 +0000
Subject: [PATCH] scripts/config: make wildcard include with no results
 non-fatal

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

SVN-Revision: 39862
---
 scripts/config/zconf.l             | 7 +++++++
 scripts/config/zconf.lex.c_shipped | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/scripts/config/zconf.l b/scripts/config/zconf.l
index bce3da6653..3aef45983a 100644
--- a/scripts/config/zconf.l
+++ b/scripts/config/zconf.l
@@ -345,6 +345,13 @@ void zconf_nextfile(const char *name)
 	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";
 
diff --git a/scripts/config/zconf.lex.c_shipped b/scripts/config/zconf.lex.c_shipped
index aae284229c..766549fbfe 100644
--- a/scripts/config/zconf.lex.c_shipped
+++ b/scripts/config/zconf.lex.c_shipped
@@ -2401,6 +2401,13 @@ void zconf_nextfile(const char *name)
 	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";
 
-- 
GitLab