aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-07-01 17:19:02 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-07-01 17:19:02 +0000
commit4a9dfc34553e74c1cbf367fabc977888f0607125 (patch)
treee5cb1b6a36a37cc13c62e1e520f7712348da876a
parent4caac48023e4e9397f21b1fdfbe5b78d7d703e03 (diff)
downloadbusybox-w32-4a9dfc34553e74c1cbf367fabc977888f0607125.tar.gz
busybox-w32-4a9dfc34553e74c1cbf367fabc977888f0607125.tar.bz2
busybox-w32-4a9dfc34553e74c1cbf367fabc977888f0607125.zip
Patch from Shaun Jackman moving the var=value logic to here it can do some good.
git-svn-id: svn://busybox.net/trunk/busybox@15575 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--shell/lash.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/shell/lash.c b/shell/lash.c
index 1b34052a1..83baee29d 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -1171,12 +1171,6 @@ static int pseudo_exec(struct child_prog *child)
1171{ 1171{
1172 struct built_in_command *x; 1172 struct built_in_command *x;
1173 1173
1174 /* Check if the command sets an environment variable. */
1175 if( strchr(child->argv[0], '=') != NULL ) {
1176 child->argv[1] = child->argv[0];
1177 _exit(builtin_export(child));
1178 }
1179
1180 /* Check if the command matches any of the non-forking builtins. 1174 /* Check if the command matches any of the non-forking builtins.
1181 * Depending on context, this might be redundant. But it's 1175 * Depending on context, this might be redundant. But it's
1182 * easier to waste a few CPU cycles than it is to figure out 1176 * easier to waste a few CPU cycles than it is to figure out
@@ -1300,6 +1294,12 @@ static int run_command(struct job *newjob, int inbg, int outpipe[2])
1300 * is doomed to failure, and doesn't work on bash, either. 1294 * is doomed to failure, and doesn't work on bash, either.
1301 */ 1295 */
1302 if (newjob->num_progs == 1) { 1296 if (newjob->num_progs == 1) {
1297 /* Check if the command sets an environment variable. */
1298 if (strchr(child->argv[0], '=') != NULL) {
1299 child->argv[1] = child->argv[0];
1300 return builtin_export(child);
1301 }
1302
1303 for (x = bltins; x->cmd; x++) { 1303 for (x = bltins; x->cmd; x++) {
1304 if (strcmp(child->argv[0], x->cmd) == 0 ) { 1304 if (strcmp(child->argv[0], x->cmd) == 0 ) {
1305 int rcode; 1305 int rcode;