diff --git a/tools/kconfig/confdata.c b/tools/kconfig/confdata.c index 70f6ab7fc..e6a7c7785 100644 --- a/tools/kconfig/confdata.c +++ b/tools/kconfig/confdata.c @@ -819,6 +819,10 @@ int conf_write(const char *name) if (*tmpname) { strcat(dirname, basename); strcat(dirname, ".old"); +#ifdef WIN32 + // On Windows rename() fails if a file exists + unlink(dirname); +#endif rename(newname, dirname); if (rename(tmpname, newname)) return 1; diff --git a/tools/kconfig/lxdialog/util.c b/tools/kconfig/lxdialog/util.c index f7abdeb92..5aecd2716 100644 --- a/tools/kconfig/lxdialog/util.c +++ b/tools/kconfig/lxdialog/util.c @@ -566,6 +566,17 @@ int on_key_esc(WINDOW *win) nodelay(win, TRUE); keypad(win, FALSE); key = wgetch(win); +#ifdef WIN32 + /* + * On Windowa ncurses uses terminal driver, which reads keys directly + * from Windows API, so it doesn't have to recognize ESC sequences and + * buffer the first ESC as a consequence. ESC is emitted instantly to + * an application, so second nodelay read will return ERR. + * Yes, there's no need to press Esc twice. + */ + if (key == ERR) + return KEY_ESC; +#endif key2 = wgetch(win); do { key3 = wgetch(win); diff --git a/tools/kconfig/symbol.c b/tools/kconfig/symbol.c index 25cf0c2c0..ae689feca 100644 --- a/tools/kconfig/symbol.c +++ b/tools/kconfig/symbol.c @@ -7,7 +7,9 @@ #include #include #include +#ifndef _WIN32 #include +#endif #include "lkc.h" @@ -44,6 +46,7 @@ static void sym_add_default(struct symbol *sym, const char *def) void sym_init(void) { +#ifndef _WIN32 struct symbol *sym; struct utsname uts; static bool inited = false; @@ -58,6 +61,7 @@ void sym_init(void) sym->type = S_STRING; sym->flags |= SYMBOL_AUTO; sym_add_default(sym, uts.release); +#endif } enum symbol_type sym_get_type(struct symbol *sym)