[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: [PATCH] which: search applet table in standalone shell mode
From: Ron Yorston <rmy () frippery ! org>
Date: 2015-05-29 10:32:19
Message-ID: 55684033.U59C1FkQsDCXSRTe%rmy () frippery ! org
[Download RAW message or body]
function old new delta
which_main 245 276 +31
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 31/0) Total: 31 bytes
Signed-off-by: Ron Yorston <rmy@pobox.com>
---
debianutils/which.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/debianutils/which.c b/debianutils/which.c
index d50e7a0..c00453b 100644
--- a/debianutils/which.c
+++ b/debianutils/which.c
@@ -16,6 +16,7 @@
//usage: "/bin/login\n"
#include "libbb.h"
+#include "NUM_APPLETS.h"
int which_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int which_main(int argc UNUSED_PARAM, char **argv)
@@ -34,6 +35,15 @@ int which_main(int argc UNUSED_PARAM, char **argv)
do {
int missing = 1;
+#if ENABLE_FEATURE_SH_STANDALONE && NUM_APPLETS != 1
+ if ( find_applet_by_name(*argv) >= 0 ) {
+ missing = 0;
+ puts(*argv);
+ if (!option_mask32) /* -a not set */
+ break;
+ }
+#endif
+
/* If file contains a slash don't use PATH */
if (strchr(*argv, '/')) {
if (file_is_executable(*argv)) {
--
2.1.0
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic