svn commit: branches/busybox_scratch/shell

aldot at busybox.net aldot at busybox.net
Sat Jul 1 10:57:59 UTC 2006


Author: aldot
Date: 2006-07-01 03:57:57 -0700 (Sat, 01 Jul 2006)
New Revision: 15566

Log:
2006-06-30  Shaun Jackman  <sjackman at gmail.com>

	* shell/lash.c (pseudo_exec): Revert svn r15378.
	(run_command): Allow setting an environment
	variable without an explicit `export'.



Modified:
   branches/busybox_scratch/shell/lash.c


Changeset:
Modified: branches/busybox_scratch/shell/lash.c
===================================================================
--- branches/busybox_scratch/shell/lash.c	2006-07-01 10:41:47 UTC (rev 15565)
+++ branches/busybox_scratch/shell/lash.c	2006-07-01 10:57:57 UTC (rev 15566)
@@ -1172,12 +1172,6 @@
 {
 	struct built_in_command *x;
 
-	/* Check if the command sets an environment variable. */
-	if( strchr(child->argv[0], '=') != NULL ) {
-		child->argv[1] = child->argv[0];
-		_exit(builtin_export(child));
-	}
-
 	/* Check if the command matches any of the non-forking builtins.
 	 * Depending on context, this might be redundant.  But it's
 	 * easier to waste a few CPU cycles than it is to figure out
@@ -1301,6 +1295,12 @@
 		 * is doomed to failure, and doesn't work on bash, either.
 		 */
 		if (newjob->num_progs == 1) {
+			/* Check if the command sets an environment variable. */
+			if (strchr(child->argv[0], '=') != NULL) {
+				child->argv[1] = child->argv[0];
+				return builtin_export(child);
+			}
+
 			for (x = bltins; x->cmd; x++) {
 				if (strcmp(child->argv[0], x->cmd) == 0 ) {
 					int rcode;




More information about the busybox-cvs mailing list