summaryrefslogtreecommitdiff
path: root/debianutils/which.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-01-28 15:31:19 +0000
committerDenis Vlasenko2007-01-28 15:31:19 +0000
commit9d938732d0e613d97e59e37f8c251f945e0350ae (patch)
tree832217179f72130cfd5b08ab52fa4beab7d3792c /debianutils/which.c
parent4e1715f4b9377a17c222d2e2f1868577f9db05fc (diff)
downloadbusybox-9d938732d0e613d97e59e37f8c251f945e0350ae.zip
busybox-9d938732d0e613d97e59e37f8c251f945e0350ae.tar.gz
fix which-uses-default-path
Diffstat (limited to 'debianutils/which.c')
-rw-r--r--debianutils/which.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/debianutils/which.c b/debianutils/which.c
index a715a26..79b2a4f 100644
--- a/debianutils/which.c
+++ b/debianutils/which.c
@@ -21,6 +21,10 @@ int which_main(int argc, char **argv)
bb_show_usage();
}
+ if (!getenv("PATH")) {
+ setenv("PATH", "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin", 1);
+ }
+
while (--argc > 0) {
argv++;
if (strchr(*argv, '/')) {