diff options
Diffstat (limited to 'shell')
| -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; |
