scripts/config: make wildcard include with no results non-fatal
authorFelix Fietkau <nbd@openwrt.org>
Mon, 10 Mar 2014 18:58:40 +0000 (18:58 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 10 Mar 2014 18:58:40 +0000 (18:58 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 39862

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

index bce3da66531e35c4ab6a7eefd11935835b9321dd..3aef45983aa1f1cc979ad2298ac7de0492cb1dfd 100644 (file)
@@ -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";
 
index aae284229cd438baef9a7597640fa582e41df845..766549fbfed1dd56f8c4b119002e9718ed2dc2fd 100644 (file)
@@ -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";