svn commit: [25957] trunk/busybox/shell: hush_test/hush-vars

vda at busybox.net vda at busybox.net
Sun Apr 5 02:10:39 UTC 2009


Author: vda
Date: 2009-04-05 02:10:39 +0000 (Sun, 05 Apr 2009)
New Revision: 25957

Log:
hush: fix passing of $n on NOMMU



Added:
   trunk/busybox/shell/hush_test/hush-vars/param_subshell.right
   trunk/busybox/shell/hush_test/hush-vars/param_subshell.tests

Modified:
   trunk/busybox/shell/hush.c


Changeset:
Modified: trunk/busybox/shell/hush.c
===================================================================
--- trunk/busybox/shell/hush.c	2009-04-05 01:46:59 UTC (rev 25956)
+++ trunk/busybox/shell/hush.c	2009-04-05 02:10:39 UTC (rev 25957)
@@ -2342,11 +2342,13 @@
 static void re_execute_shell(const char *s)
 {
 	struct variable *cur;
-	char **argv, **pp;
+	char **argv, **pp, **pp2;
 	unsigned cnt;
 
-	/* hush -$<pid> -?<exitcode> -D<depth> ... -c <cmd> NULL */
-	cnt = 7;
+	/* 1:hush 2:-$<pid> 3:-?<exitcode> 4:-D<depth> <vars...>
+	 * 5:-c 6:<cmd> <argN...> 7:NULL
+	 */
+	cnt = 7 + G.global_argc;
 	for (cur = G.top_var; cur; cur = cur->next) {
 		if (!cur->flg_export || cur->flg_read_only)
 			cnt += 2;
@@ -2370,7 +2372,9 @@
 	}
 	*pp++ = (char *) "-c";
 	*pp++ = (char *) s;
-//TODO: pass $N
+	pp2 = G.global_argv;
+	while (*pp2)
+		*pp++ = *pp2++;
 	*pp = NULL;
 //TODO: pass traps and functions
 

Added: trunk/busybox/shell/hush_test/hush-vars/param_subshell.right
===================================================================
--- trunk/busybox/shell/hush_test/hush-vars/param_subshell.right	                        (rev 0)
+++ trunk/busybox/shell/hush_test/hush-vars/param_subshell.right	2009-04-05 02:10:39 UTC (rev 25957)
@@ -0,0 +1,7 @@
+1=1
+2=2
+3=3
+4=4
+5=5
+6=6
+7=7

Added: trunk/busybox/shell/hush_test/hush-vars/param_subshell.tests
===================================================================
--- trunk/busybox/shell/hush_test/hush-vars/param_subshell.tests	                        (rev 0)
+++ trunk/busybox/shell/hush_test/hush-vars/param_subshell.tests	2009-04-05 02:10:39 UTC (rev 25957)
@@ -0,0 +1,13 @@
+if test $# = 0; then
+    "$THIS_SH" "$0" 1 2 3 4 5 6 7 8 9
+    exit
+fi
+echo 1=$1
+{ echo 2=$2; }
+{ echo 3=$3; } &
+usleep 100000
+( echo 4=$4 )
+( echo 5=$5 ) &
+usleep 100000
+true | echo 6=$6 | cat
+true | { echo 7=$7; } | cat


Property changes on: trunk/busybox/shell/hush_test/hush-vars/param_subshell.tests
___________________________________________________________________
Added: svn:executable
   + *



More information about the busybox-cvs mailing list