From 2211b446d8ba209d75974a6835aecda3d8358047 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 24 Apr 2022 11:25:30 +0100 Subject: ash: avoid misleading '.exe' in standalone shell mode In dash a command with an explicit path has an index value of -1 in its cmdentry structure. Upstream BusyBox extends this to allow other negative values for applets in standalone shell mode. busybox-w32 adds a further extension, with the index value INT_MIN indicating an applet with a Unix-style path. In describe_command() the command should only have a '.exe' extension added for index == -1, the original dash case of an explicit path. (GitHub issue #248) --- shell/ash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/ash.c b/shell/ash.c index 35aa3f6e6..afb865146 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -9454,7 +9454,7 @@ describe_command(char *command, const char *path, int describe_command_verbose) int j = entry.u.index; char *p; #if ENABLE_PLATFORM_MINGW32 && ENABLE_FEATURE_SH_STANDALONE - if (j == INT_MIN) { + if (j < -1) { p = (char *)bb_basename(command); goto describe; } -- cgit v1.2.3-55-g6feb