X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=scripts%2Fconfig%2Fzconf.l;h=7c7baefda791cfdef4757a242a25641c7b87a4ec;hb=a9f6941436e83d2f91caf06c13bee86cad309064;hp=3aef45983aa1f1cc979ad2298ac7de0492cb1dfd;hpb=81013f6bbecf5177ae472d01365c066504ccbdb8;p=openwrt%2Fstaging%2Fchunkeey.git diff --git a/scripts/config/zconf.l b/scripts/config/zconf.l index 3aef45983a..7c7baefda7 100644 --- a/scripts/config/zconf.l +++ b/scripts/config/zconf.l @@ -14,6 +14,7 @@ #include #include #include +#include #include "lkc.h" @@ -28,8 +29,8 @@ static char *text; static int text_size, text_asize; struct buffer { - struct buffer *parent; - YY_BUFFER_STATE state; + struct buffer *parent; + YY_BUFFER_STATE state; }; struct buffer *current_buf; @@ -69,7 +70,6 @@ static void alloc_string(const char *str, int size) } %} -ws [ \n\t] n [A-Za-z0-9_] %% @@ -343,6 +343,7 @@ void zconf_nextfile(const char *name) glob_t gl; int err; int i; + char path[PATH_MAX], *p; err = glob(name, GLOB_ERR | GLOB_MARK, NULL, &gl); @@ -352,6 +353,15 @@ void zconf_nextfile(const char *name) gl.gl_pathc = 0; } + if (err == GLOB_NOMATCH) { + p = strdup(current_file->name); + if (p) { + snprintf(path, sizeof(path), "%s/%s", dirname(p), name); + err = glob(path, GLOB_ERR | GLOB_MARK, NULL, &gl); + free(p); + } + } + if (err) { const char *reason = "unknown error";