From 8dee37d53a47b8f96ba609d65d85438ef4e14fea Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Fri, 2 Feb 2024 11:43:15 +0000 Subject: win32: rearrange applet override handling - Rename some functions to be more meaningful. - Adjust conditional compilation to clarify which code is required for 'standalone shell' and 'exec prefers applets' settings. This shouldn't result in any change to the behaviour or size of default builds. --- shell/ash.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'shell') diff --git a/shell/ash.c b/shell/ash.c index 235eb8b7d..5b73c3c66 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -9197,7 +9197,7 @@ static void shellexec(char *prog, char **argv, const char *path, int idx) if (has_path(prog) #endif #if ENABLE_FEATURE_SH_STANDALONE - || (applet_no = find_applet_by_name_with_path(prog, path)) >= 0 + || (applet_no = find_applet_by_name_for_sh(prog, path)) >= 0 #endif ) { #if ENABLE_PLATFORM_MINGW32 @@ -9218,7 +9218,7 @@ static void shellexec(char *prog, char **argv, const char *path, int idx) if (unix_path(prog)) { const char *name = bb_basename(prog); # if ENABLE_FEATURE_SH_STANDALONE - if ((applet_no = find_applet_by_name_with_path(name, path)) >= 0) { + if ((applet_no = find_applet_by_name_for_sh(name, path)) >= 0) { tryexec(applet_no, name, argv, envp); e = errno; } @@ -15055,7 +15055,7 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) name = (char *)bb_basename(name); if ( # if ENABLE_FEATURE_SH_STANDALONE - find_applet_by_name_with_path(name, path) >= 0 || + find_applet_by_name_for_sh(name, path) >= 0 || # endif !find_builtin(bb_basename(name)) ) { @@ -15126,7 +15126,7 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) #if ENABLE_FEATURE_SH_STANDALONE { - int applet_no = find_applet_by_name_with_path(name, path); + int applet_no = find_applet_by_name_for_sh(name, path); if (applet_no >= 0) { entry->cmdtype = CMDNORMAL; entry->u.index = -2 - applet_no; @@ -15379,7 +15379,7 @@ helpcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) { const char *a = applet_names; while (*a) { - if (is_applet_preferred(a, pathval())) { + if (prefer_applet(a, pathval())) { col += out1fmt("%c%s", ((col == 0) ? '\t' : ' '), a); if (col > 60) { out1fmt("\n"); -- cgit v1.2.3-55-g6feb