scripts/config: make wildcard include with no results non-fatal
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 10 Mar 2014 18:58:40 +0000 (18:58 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 10 Mar 2014 18:58:40 +0000 (18:58 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39862 3c298f89-4303-0410-b956-a3cf2f4a3e73

scripts/config/zconf.l
scripts/config/zconf.lex.c_shipped

index bce3da6..3aef459 100644 (file)
@@ -345,6 +345,13 @@ void zconf_nextfile(const char *name)
        int i;
 
        err = glob(name, GLOB_ERR | GLOB_MARK, NULL, &gl);
        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";
 
        if (err) {
                const char *reason = "unknown error";
 
index aae2842..766549f 100644 (file)
@@ -2401,6 +2401,13 @@ void zconf_nextfile(const char *name)
        int i;
 
        err = glob(name, GLOB_ERR | GLOB_MARK, NULL, &gl);
        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";
 
        if (err) {
                const char *reason = "unknown error";