diff options
Diffstat (limited to 'scripts/kconfig')
-rw-r--r-- | scripts/kconfig/confdata.c | 3 | ||||
-rw-r--r-- | scripts/kconfig/mconf.c | 2 | ||||
-rw-r--r-- | scripts/kconfig/zconf.l | 3 | ||||
-rw-r--r-- | scripts/kconfig/zconf.y | 6 |
4 files changed, 9 insertions, 5 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 9365a12..4f83fbf 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -70,12 +70,13 @@ static char *conf_expand_value(const char *in) char *conf_get_default_confname(void) { struct stat buf; - static char fullname[PATH_MAX+1]; + static char *fullname = NULL; char *env, *name; name = conf_expand_value(conf_defname); env = getenv(SRCTREE); if (env) { + fullname = realloc(fullname, strlen(env) + strlen(name) + 2); sprintf(fullname, "%s/%s", env, name); if (!stat(fullname, &buf)) return fullname; diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 647ec09..0c548bf 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -258,7 +258,7 @@ search_help[] = N_( static char buf[4096], *bufptr = buf; static char input_buf[4096]; -static char filename[PATH_MAX+1] = ".config"; +static const char filename[] = ".config"; static char *args[1024], **argptr = args; static int indent; static struct termios ios_org; diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index d839577..6a58b80 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -265,13 +265,14 @@ static void zconf_endhelp(void) */ FILE *zconf_fopen(const char *name) { - char *env, fullname[PATH_MAX+1]; + char *env; FILE *f; f = fopen(name, "r"); if (!f && name[0] != '/') { env = getenv(SRCTREE); if (env) { + char *fullname = alloca(strlen(env) + strlen(name) + 2); sprintf(fullname, "%s/%s", env, name); f = fopen(fullname, "r"); } diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 0a7a796..2007a4e 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -14,8 +14,6 @@ #define LKC_DIRECT_LINK #include "lkc.h" -#include "zconf.hash.c" - #define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt) #define PRINTD 0x0001 @@ -99,6 +97,10 @@ static struct menu *current_menu, *current_entry; menu_end_menu(); } if_entry menu_entry choice_entry +%{ +#include "zconf.hash.c" +%} + %% input: stmt_list; |