aboutsummaryrefslogtreecommitdiff
path: root/sh.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-11-17 18:07:30 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-11-17 18:07:30 +0000
commit205d4e61e6a0de7df73be2720f27651bc4370f10 (patch)
treec0c5859b8b8182c0c11e2662cdead1ca10fc38d8 /sh.c
parentaff4d641bbe3d09c96a5addefbd6e48f8067eb03 (diff)
downloadbusybox-w32-205d4e61e6a0de7df73be2720f27651bc4370f10.tar.gz
busybox-w32-205d4e61e6a0de7df73be2720f27651bc4370f10.tar.bz2
busybox-w32-205d4e61e6a0de7df73be2720f27651bc4370f10.zip
Add in a new FEATURE (off by default) BB_FEATURE_SH_BUILTINS_ALWAYS_WIN.
Make the sh default to using external commands when a path is provided. git-svn-id: svn://busybox.net/trunk/busybox@1321 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'sh.c')
-rw-r--r--sh.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/sh.c b/sh.c
index 7a8810aef..d6ac1fc17 100644
--- a/sh.c
+++ b/sh.c
@@ -1216,7 +1216,24 @@ static int runCommand(struct job *newJob, struct jobSet *jobList, int inBg, int
1216#ifdef BB_FEATURE_SH_STANDALONE_SHELL 1216#ifdef BB_FEATURE_SH_STANDALONE_SHELL
1217 /* Check if the command matches any busybox internal commands here */ 1217 /* Check if the command matches any busybox internal commands here */
1218 while (a->name != 0) { 1218 while (a->name != 0) {
1219 if (strcmp(get_last_path_component(newJob->progs[i].argv[0]), a->name) == 0) { 1219#ifdef BB_FEATURE_SH_BUILTINS_ALWAYS_WIN
1220 if (strcmp(get_last_path_component(newJob->progs[i].argv[0]),
1221 a->name) == 0)
1222#else
1223 /* Check if the command matches any busybox internal
1224 * commands ("applets") here. Following discussions from
1225 * November 2000 on busybox@opensource.lineo.com, don't use
1226 * get_last_path_component(). This way explicit (with
1227 * slashes) filenames will never be interpreted as an
1228 * applet, just like with builtins. This way the user can
1229 * override an applet with an explicit filename reference.
1230 * The only downside to this change is that an explicit
1231 * /bin/foo invocation fill fork and exec /bin/foo, even if
1232 * /bin/foo is a symlink to busybox.
1233 */
1234 if (strcmp(newJob->progs[i].argv[0], a->name) == 0)
1235#endif
1236 {
1220 int argc_l; 1237 int argc_l;
1221 char** argv=newJob->progs[i].argv; 1238 char** argv=newJob->progs[i].argv;
1222 for(argc_l=0;*argv!=NULL; argv++, argc_l++); 1239 for(argc_l=0;*argv!=NULL; argv++, argc_l++);