aboutsummaryrefslogtreecommitdiff
path: root/debianutils
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-02-28 19:57:02 +0000
committerRon Yorston <rmy@pobox.com>2018-02-28 20:23:18 +0000
commitf5783ef14f9ad96ae483f16e639953d0212ca7d0 (patch)
tree521ecd0a4cfa4c789f559fcef3982271d3c21bf6 /debianutils
parent92dbd3c0932abbfb6814554603abd38e3eb9d953 (diff)
downloadbusybox-w32-f5783ef14f9ad96ae483f16e639953d0212ca7d0.tar.gz
busybox-w32-f5783ef14f9ad96ae483f16e639953d0212ca7d0.tar.bz2
busybox-w32-f5783ef14f9ad96ae483f16e639953d0212ca7d0.zip
win32: additional improvements to handling of executables
Consistent processing of file extensions, as described in the previous commit, has been applied to the 'which' applet and the functions find_executable and mingw_spawn_interpreter. In spawnveq check that the file to be executed exists and is executable, and ensure that it won't have any extensions added by spawnve. It's intended that all files passed to spawnve should have their names fully specified. If this isn't the case the tests here will cause errors which will need to be fixed.
Diffstat (limited to 'debianutils')
-rw-r--r--debianutils/which.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/debianutils/which.c b/debianutils/which.c
index 9060a5b47..0b0a6a645 100644
--- a/debianutils/which.c
+++ b/debianutils/which.c
@@ -66,17 +66,18 @@ int which_main(int argc UNUSED_PARAM, char **argv)
66 66
67 /* If file contains a slash don't use PATH */ 67 /* If file contains a slash don't use PATH */
68 if (strchr(*argv, '/') || (ENABLE_PLATFORM_MINGW32 && strchr(*argv, '\\'))) { 68 if (strchr(*argv, '/') || (ENABLE_PLATFORM_MINGW32 && strchr(*argv, '\\'))) {
69 if (file_is_executable(*argv)) {
70 missing = 0;
71 puts(*argv);
72 }
73#if ENABLE_PLATFORM_MINGW32 69#if ENABLE_PLATFORM_MINGW32
74 else if ((p=add_win32_extension(*argv)) != NULL) { 70 if ((p=add_win32_extension(*argv)) != NULL) {
75 missing = 0; 71 missing = 0;
76 puts(p); 72 puts(p);
77 free(p); 73 free(p);
78 } 74 }
75 else
79#endif 76#endif
77 if (file_is_executable(*argv)) {
78 missing = 0;
79 puts(*argv);
80 }
80 } else { 81 } else {
81 char *path; 82 char *path;
82 83