diff options
| author | Rob Landley <rob@landley.net> | 2006-07-01 17:19:02 +0000 |
|---|---|---|
| committer | Rob Landley <rob@landley.net> | 2006-07-01 17:19:02 +0000 |
| commit | 7a8e491dffe98ebc19fa83c2785c8477522e3270 (patch) | |
| tree | e5cb1b6a36a37cc13c62e1e520f7712348da876a | |
| parent | 7ccb65f3a4f5c84d010978d450df57d3c1b13297 (diff) | |
| download | busybox-w32-7a8e491dffe98ebc19fa83c2785c8477522e3270.tar.gz busybox-w32-7a8e491dffe98ebc19fa83c2785c8477522e3270.tar.bz2 busybox-w32-7a8e491dffe98ebc19fa83c2785c8477522e3270.zip | |
Patch from Shaun Jackman moving the var=value logic to here it can do some good.
| -rw-r--r-- | shell/lash.c | 12 |
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; |
