X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=scripts%2Fconfig%2Fzconf.lex.c_shipped;h=f1d652829301afa7c7eefce0a244857ce75806f6;hb=a9f6941436e83d2f91caf06c13bee86cad309064;hp=766549fbfed1dd56f8c4b119002e9718ed2dc2fd;hpb=81013f6bbecf5177ae472d01365c066504ccbdb8;p=openwrt%2Fstaging%2Fdedeckeh.git diff --git a/scripts/config/zconf.lex.c_shipped b/scripts/config/zconf.lex.c_shipped index 766549fbfe..f1d6528293 100644 --- a/scripts/config/zconf.lex.c_shipped +++ b/scripts/config/zconf.lex.c_shipped @@ -777,6 +777,7 @@ char *zconftext; #include #include #include +#include #include "lkc.h" @@ -791,8 +792,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; @@ -2399,6 +2400,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); @@ -2408,6 +2410,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";