hush: fix "hush -c 'echo $#'" showing -1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
		@@ -1,4 +1,9 @@
 | 
			
		||||
0
 | 
			
		||||
0
 | 
			
		||||
1
 | 
			
		||||
Make sure len parsing doesnt break arg count
 | 
			
		||||
0 0
 | 
			
		||||
4 4
 | 
			
		||||
Testing len op
 | 
			
		||||
4 3 2 1 0 0
 | 
			
		||||
0 3 0
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,14 @@
 | 
			
		||||
# make sure len parsing doesnt break arg count
 | 
			
		||||
"$THIS_SH" -c 'echo $#'
 | 
			
		||||
"$THIS_SH" -c 'echo $#' arg0
 | 
			
		||||
"$THIS_SH" -c 'echo $#' arg0 arg1
 | 
			
		||||
 | 
			
		||||
echo Make sure len parsing doesnt break arg count
 | 
			
		||||
set --
 | 
			
		||||
echo $# ${#}
 | 
			
		||||
set -- aaaa bbb cc d
 | 
			
		||||
echo $# ${#}
 | 
			
		||||
 | 
			
		||||
echo Testing len op
 | 
			
		||||
echo ${#1} ${#2} ${#3} ${#4} ${#5} ${#6}
 | 
			
		||||
 | 
			
		||||
unset e
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user