From e013876e1dc0ce8e3a36abea9390d35a7053bd84 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sat, 3 Jun 2023 07:27:04 +0100 Subject: win32: fix BB_OVERRIDE_APPLETS Now that BB_OVERRIDE_APPLETS can affect how the shell searches PATH it may be necessary to invalidate the command table when it changes. It's probably not worth being clever about this: just invalidate the cache on every change. Adds 40-80 bytes (GitHub issue #329) --- shell/ash.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'shell') diff --git a/shell/ash.c b/shell/ash.c index fda4541b4..07319dbdf 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -2350,6 +2350,13 @@ change_terminal_mode(const char *newval UNUSED_PARAM) terminal_mode(TRUE); } +static void clearcmdentry(void); +static void FAST_FUNC +change_override_applets(const char *newval UNUSED_PARAM) +{ + clearcmdentry(); +} + # define LINENO_INDEX (5 + 2 * ENABLE_ASH_MAIL + ENABLE_ASH_GETOPTS) # define FUNCNAME_INDEX (LINENO_INDEX + 1) #endif @@ -2394,6 +2401,7 @@ static const struct { #if ENABLE_PLATFORM_MINGW32 { VSTRFIXED|VTEXTFIXED|VUNSET, BB_SKIP_ANSI_EMULATION, change_terminal_mode }, { VSTRFIXED|VTEXTFIXED|VUNSET, BB_TERMINAL_MODE, change_terminal_mode }, + { VSTRFIXED|VTEXTFIXED|VUNSET, BB_OVERRIDE_APPLETS, change_override_applets }, #endif }; -- cgit v1.2.3-55-g6feb