diff options
author | Ron Yorston <rmy@pobox.com> | 2012-05-09 15:16:44 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2012-05-09 15:16:44 +0100 |
commit | 4066aff5e481941585c5958460c39a1b1399ce88 (patch) | |
tree | 87f3996a592298e744faa6b17b0af17c3786510a /debianutils | |
parent | f2459f232790aab0434d1cc6471ea62bc193e636 (diff) | |
download | busybox-w32-4066aff5e481941585c5958460c39a1b1399ce88.tar.gz busybox-w32-4066aff5e481941585c5958460c39a1b1399ce88.tar.bz2 busybox-w32-4066aff5e481941585c5958460c39a1b1399ce88.zip |
Use win32_execable_file() in test, which and execable.c
Diffstat (limited to 'debianutils')
-rw-r--r-- | debianutils/which.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/debianutils/which.c b/debianutils/which.c index 2b5804e00..bcca95331 100644 --- a/debianutils/which.c +++ b/debianutils/which.c | |||
@@ -21,29 +21,6 @@ | |||
21 | 21 | ||
22 | #include "libbb.h" | 22 | #include "libbb.h" |
23 | 23 | ||
24 | #if ENABLE_PLATFORM_MINGW32 | ||
25 | static char *win32_execable_file(const char *p) | ||
26 | { | ||
27 | char *path; | ||
28 | int len = strlen(p) + 5; | ||
29 | |||
30 | if ( (path=malloc(len)) != NULL ) { | ||
31 | memcpy(path, p, len); | ||
32 | memcpy(path+len, ".exe", 5); | ||
33 | if (execable_file(path)) { | ||
34 | return path; | ||
35 | } | ||
36 | memcpy(path+len, ".com", 5); | ||
37 | if (execable_file(path)) { | ||
38 | return path; | ||
39 | } | ||
40 | free(path); | ||
41 | } | ||
42 | |||
43 | return NULL; | ||
44 | } | ||
45 | #endif | ||
46 | |||
47 | int which_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 24 | int which_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
48 | int which_main(int argc UNUSED_PARAM, char **argv) | 25 | int which_main(int argc UNUSED_PARAM, char **argv) |
49 | { | 26 | { |