aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/shell/ash.c b/shell/ash.c
index b29927a83..721204c61 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -428,13 +428,21 @@ static void forkshell_print(FILE *fp0, struct forkshell *fs, const char **notes)
428 428
429#if ENABLE_PLATFORM_MINGW32 && NUM_APPLETS > 1 && \ 429#if ENABLE_PLATFORM_MINGW32 && NUM_APPLETS > 1 && \
430 (ENABLE_FEATURE_PREFER_APPLETS || ENABLE_FEATURE_SH_STANDALONE) 430 (ENABLE_FEATURE_PREFER_APPLETS || ENABLE_FEATURE_SH_STANDALONE)
431static int 431static const char *ash_path;
432ash_preferred_applet_by_name(const char *name, const char *path) 432
433const char *
434get_ash_path(void)
435{
436 return ash_path;
437}
438
439static int NOINLINE
440ash_applet_by_name(const char *name, const char *path)
433{ 441{
434 int ret; 442 int ret;
435 443
436 ash_path = path; 444 ash_path = path;
437 ret = find_preferred_applet_by_name(name); 445 ret = find_applet_by_name(name);
438 ash_path = NULL; 446 ash_path = NULL;
439 447
440 return ret; 448 return ret;
@@ -451,11 +459,12 @@ ash_applet_preferred(const char *name, const char *path)
451 459
452 return ret; 460 return ret;
453} 461}
454# undef find_applet_by_name 462# define find_applet_by_name(n, p) ash_applet_by_name(n, p)
455# define find_applet_by_name(n, p) ash_preferred_applet_by_name(n, p)
456# define is_applet_preferred(n, p) ash_applet_preferred(n, p) 463# define is_applet_preferred(n, p) ash_applet_preferred(n, p)
457#else 464#else
458# define find_applet_by_name(n, p) find_applet_by_name(n) 465# define find_applet_by_name(n, p) find_applet_by_name(n)
466# undef is_applet_preferred
467# define is_applet_preferred(n, p) (1)
459#endif 468#endif
460 469
461/* ============ Hash table sizes. Configurable. */ 470/* ============ Hash table sizes. Configurable. */