mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-09-26 22:10:45 +02:00
30388, 30389 (Stephane): zargs: handle zero-length arguments.
This commit is contained in:
parent
4a4d9f3cbe
commit
5e2fe3ca18
@ -1,3 +1,8 @@
|
||||
2012-04-12 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* 30388, 30389 (Stephane): Functions/Misc/zargs: handle
|
||||
zero-length arguments.
|
||||
|
||||
2012-04-09 Barton E. Schaefer <schaefer@zsh.org>
|
||||
|
||||
* unposted: Test/D04parameter.ztst: hash seive needs more than 10
|
||||
@ -16164,5 +16169,5 @@
|
||||
|
||||
*****************************************************
|
||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
||||
* $Revision: 1.5621 $
|
||||
* $Revision: 1.5622 $
|
||||
*****************************************************
|
||||
|
@ -167,14 +167,14 @@ if [[ $eof == -(e|-eof) ]]; then ((end=ARGC+1))
|
||||
elif (( $#eof )); then end=$argv[(i)${eof##-(e|-eof=)}]
|
||||
else end=$argv[(i)--]
|
||||
fi
|
||||
local -a args call command; command=( ${argv[end+1,-1]} )
|
||||
local -a args call command; command=( "${(@)argv[end+1,-1]}" )
|
||||
|
||||
if (( $opts[(I)-(null|0)] ))
|
||||
then set -- ${(ps:\000:)argv[1,end-1]}
|
||||
else set -- $argv[1,end-1]
|
||||
then set -- "${(@ps:\000:)argv[1,end-1]}"
|
||||
else set -- "${(@)argv[1,end-1]}"
|
||||
fi
|
||||
|
||||
if [[ -n $command ]]
|
||||
if (( $#command ))
|
||||
then (( c = $#command - 1 ))
|
||||
else command=( print -r -- )
|
||||
fi
|
||||
@ -187,7 +187,7 @@ local execute='
|
||||
then print -u2 -r -- "$call"
|
||||
fi
|
||||
eval "{
|
||||
\$call
|
||||
\"\${(@)call}\"
|
||||
} $bg"'
|
||||
local ret=0 analyze='
|
||||
case $? in
|
||||
@ -275,11 +275,11 @@ do
|
||||
((ARGC)) || break
|
||||
for (( end=l; end && ${(c)#argv[1,end]} > s; end/=2 )) { }
|
||||
(( end > n && ( end = n ) ))
|
||||
args=( $argv[1,end] )
|
||||
args=( "${(@)argv[1,end]}" )
|
||||
shift $((end > ARGC ? ARGC : end))
|
||||
if (( $#i ))
|
||||
then call=( ${command/$i/$args} )
|
||||
else call=( $command $args )
|
||||
then call=( "${(@)command/$i/$args}" )
|
||||
else call=( "${(@)command}" "${(@)args}" )
|
||||
fi
|
||||
if (( ${(c)#call} > s ))
|
||||
then
|
||||
|
Loading…
Reference in New Issue
Block a user