* Based on which from debianutils
*/
-#include "busybox.h"
+#include "libbb.h"
+int which_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int which_main(int argc, char **argv)
{
int status = EXIT_SUCCESS;
bb_show_usage();
}
+ /* This matches what is seen on e.g. ubuntu
+ * "which" there is a shell script */
if (!getenv("PATH")) {
- setenv("PATH", "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin", 1);
+ putenv((char*)bb_PATH_root_path);
}
while (--argc > 0) {