aboutsummaryrefslogtreecommitdiff
path: root/debianutils
diff options
context:
space:
mode:
Diffstat (limited to 'debianutils')
-rw-r--r--debianutils/pipe_progress.c7
-rw-r--r--debianutils/which.c38
2 files changed, 41 insertions, 4 deletions
diff --git a/debianutils/pipe_progress.c b/debianutils/pipe_progress.c
index ab7e2528f..28c4fd70e 100644
--- a/debianutils/pipe_progress.c
+++ b/debianutils/pipe_progress.c
@@ -16,8 +16,11 @@
16 16
17//kbuild:lib-$(CONFIG_PIPE_PROGRESS) += pipe_progress.o 17//kbuild:lib-$(CONFIG_PIPE_PROGRESS) += pipe_progress.o
18 18
19//usage:#define pipe_progress_trivial_usage NOUSAGE_STR 19//usage:#define pipe_progress_trivial_usage IF_PLATFORM_POSIX(NOUSAGE_STR)
20//usage:#define pipe_progress_full_usage "" 20//usage: IF_PLATFORM_MINGW32("")
21//usage:#define pipe_progress_full_usage IF_PLATFORM_POSIX("")
22//usage: IF_PLATFORM_MINGW32("\n\n")
23//usage: IF_PLATFORM_MINGW32("Display a dot to indicate pipe activity")
21 24
22#include "libbb.h" 25#include "libbb.h"
23 26
diff --git a/debianutils/which.c b/debianutils/which.c
index 98876521f..61f5770c5 100644
--- a/debianutils/which.c
+++ b/debianutils/which.c
@@ -45,21 +45,55 @@ int which_main(int argc UNUSED_PARAM, char **argv)
45 45
46 do { 46 do {
47 int missing = 1; 47 int missing = 1;
48 char *p;
49
50#if ENABLE_FEATURE_SH_STANDALONE
51 if (strcmp(*argv, "busybox") == 0 &&
52 is_suffixed_with(bb_busybox_exec_path, "busybox.exe")) {
53 missing = 0;
54 puts(bb_busybox_exec_path);
55 if (!option_mask32) /* -a not set */
56 break;
57 }
58 else if (find_applet_by_name(*argv) >= 0 ||
59 is_prefixed_with(*argv, "busybox")) {
60 missing = 0;
61 puts(*argv);
62 if (!option_mask32) /* -a not set */
63 break;
64 }
65#endif
48 66
49 /* If file contains a slash don't use PATH */ 67 /* If file contains a slash don't use PATH */
50 if (strchr(*argv, '/')) { 68 if (strchr(*argv, '/') || (ENABLE_PLATFORM_MINGW32 && strchr(*argv, '\\'))) {
69#if ENABLE_PLATFORM_MINGW32
70 if ((p=auto_win32_extension(*argv)) != NULL) {
71 missing = 0;
72 bs_to_slash(p);
73 puts(p);
74 }
75 else
76#endif
51 if (file_is_executable(*argv)) { 77 if (file_is_executable(*argv)) {
52 missing = 0; 78 missing = 0;
79#if ENABLE_PLATFORM_MINGW32
80 p = auto_string(xstrdup(*argv));
81 bs_to_slash(p);
82 puts(p);
83#else
53 puts(*argv); 84 puts(*argv);
85#endif
54 } 86 }
55 } else { 87 } else {
56 char *path; 88 char *path;
57 char *p;
58 89
59 path = env_path; 90 path = env_path;
60 /* NOFORK NB: xmalloc inside find_executable(), must have no allocs above! */ 91 /* NOFORK NB: xmalloc inside find_executable(), must have no allocs above! */
61 while ((p = find_executable(*argv, &path)) != NULL) { 92 while ((p = find_executable(*argv, &path)) != NULL) {
62 missing = 0; 93 missing = 0;
94#if ENABLE_PLATFORM_MINGW32
95 bs_to_slash(p);
96#endif
63 puts(p); 97 puts(p);
64 free(p); 98 free(p);
65 if (!option_mask32) /* -a not set */ 99 if (!option_mask32) /* -a not set */