Permalink
Browse files

change $* to "$@" (quoted) in most places per http://zshwiki.org/home…

  • Loading branch information...
1 parent d602a21 commit cb5221fe3c3aacfbf9799c28bfb94ed4be3712e7 @rsanders committed Feb 13, 2012
View
2 zsh/core/start_profiling
@@ -11,7 +11,7 @@ function () {
local ___ps_funname="" ___ps_file="$1" ___ps_result=0 ___realname="${0}" result
local -a ___sargs
shift
- ___sargs=($*)
+ ___sargs=("$@")
___ps_funname=source_${${${___ps_file#"$DOTTODIR/"}//\//_}//./}
function $___ps_funname { builtin $___realname $___ps_file $___sargs }
View
4 zsh/functions/autoload_from
@@ -11,10 +11,10 @@
local alf_func
shift
- for alf_func in $*
+ for alf_func in "$@"
do
if !
- eval "function $alf_func () { source $alf_file; $alf_func \$* }"
+ eval "function $alf_func () { source $alf_file; $alf_func \"\$@\" }"
done
View
2 zsh/functions/dotto_version
@@ -50,4 +50,4 @@ function dotto_version {
[[ -n $DOTTO_VERSION ]]
}
-dotto_version $*
+dotto_version "$@"
View
2 zsh/functions/profiling_dot
@@ -3,7 +3,7 @@
local ___ps_funname="" ___ps_file="$1" ___ps_result=0 result
local -a ___sargs
shift
- ___sargs=($*)
+ ___sargs=("$@")
___ps_funname=source_${${${___ps_file#"$DOTTODIR/"}//\//_}//./}
function $___ps_funname { builtin . $___ps_file $___sargs }
View
2 zsh/functions/profiling_source
@@ -8,7 +8,7 @@
local ___ps_funname="" ___ps_file="$1" ___ps_result=0 result
local -a ___sargs
shift
- ___sargs=($*)
+ ___sargs=("$@")
___ps_funname=source_${${${___ps_file#"$DOTTODIR/"}//\//_}//./}
function $___ps_funname { builtin source $___ps_file $___sargs }
View
2 zsh/functions/request
@@ -6,7 +6,7 @@
#
local file
- for file in $*; do
+ for file in "$@"; do
[[ -r $file || (-h $file && -f ${file:A}) ]] && source $file
done
View
4 zsh/functions/set~prepend
@@ -8,6 +8,6 @@
local name=$1
shift
- set~remove $name $*
- set -A $name $* ${(P)name}
+ set~remove $name "$@"
+ set -A $name "$@" ${(P)name}
View
2 zsh/functions/unshift
@@ -5,5 +5,5 @@
local name=$1
shift
- set -A $name $* ${(P)name}
+ set -A $name "$@" ${(P)name}
View
2 zsh/functions/uselib
@@ -93,4 +93,4 @@ function uselib {
REPLY=""
}
-uselib $*
+uselib "$@"
View
2 zsh/functions/zalwhich
@@ -15,7 +15,7 @@
# get rid of header line
lines[1]=()
- for name in $*; do
+ for name in "$@"; do
[[ -z $lines[(r)*/${name}] ]] && return 1
done
return 0
View
2 zsh/functions/zavp
@@ -141,4 +141,4 @@ function zavp_test {
[[ $val[1,7] == $zavp_vars[magic] && $val[-7,-1] == $zavp_vars[magic] ]]
}
-zavp $*
+zavp "$@"
View
2 zsh/functions/zinvoke
@@ -71,7 +71,7 @@
fi
fi
- { $* } &> /dev/null
+ { "$@" } &> /dev/null
retstat=$?
# keep the reply/REPLY vars from being clobbered by localizing them,
View
2 zsh/functions/zmemcache
@@ -19,4 +19,4 @@ function zmemcache () {
return
}
-zmemcache $*
+zmemcache "$@"
View
10 zsh/functions/zmemoize
@@ -236,7 +236,7 @@ function _zmemoize_wrapper {
local key="" cached="" funcname=$1 capture=1
typeset -A zdecoded
- _zmemoize_calculate_key $*
+ _zmemoize_calculate_key "$@"
key=$REPLY
cached=$zmemoize_cache[$key]
@@ -258,9 +258,9 @@ function _zmemoize_wrapper {
fi
if [[ $capture == 1 ]]; then
- _zmemoize_capture $key $*
+ _zmemoize_capture $key "$@"
else
- $*
+ "$@"
fi
}
@@ -452,7 +452,7 @@ Options:
unfunction $wrappername &>/dev/null
zshellfunc_rename $funcname $wrappername || { echo "FAILED TO RENAME: $?" >&2; return 20 }
function $funcname {
- _zmemoize_wrapper $0 $*
+ _zmemoize_wrapper $0 "$@"
}
zavp -v memodef >/dev/null
@@ -462,4 +462,4 @@ Options:
zmemoize_reset
-zmemoize $*
+zmemoize "$@"
View
2 zsh/functions/zraketargets
@@ -1,6 +1,6 @@
#!/bin/zsh
- command rake -T $*
+ command rake -T "$@"
DOTTO_DEBUG=1 zlog "called zraketargets: ${*}"
View
4 zsh/functions/zrunsystem
@@ -39,7 +39,7 @@ function _zsys_add_rooted_dirs {
local var=$1 dir
shift
- for dir in $*; do
+ for dir in "$@"; do
for droot in $zsystem_roots; do
[[ -n "$droot" ]] && droot="${droot%/}/"
[[ -d "${droot}${dir}" ]] && eval "${var}+='${droot}${dir}'"
@@ -137,4 +137,4 @@ function zrunsystem() {
_zrunsystem_setup
-zrunsystem $*
+zrunsystem "$@"
View
4 zsh/functions/zshellfunc_rename
@@ -49,10 +49,10 @@
builtin unhash $old
;;
command)
- builtin eval "function $new { command $old \$* }"
+ builtin eval "function $new { command $old \"\$@\" }"
;;
builtin)
- builtin eval "function $new { builtin $old \$* }"
+ builtin eval "function $new { builtin $old \"\$@\" }"
;;
*) echo "Cannot rename function of type $ftype" >&2
return 3
View
2 zsh/functions/zsystemroots
@@ -36,4 +36,4 @@ function zsystemroots() {
}
-zsystemroots $*
+zsystemroots "$@"
View
4 zsh/functions/ztmpfile
@@ -26,7 +26,7 @@ function ztmpfile {
REPLY="${TMPPREFIX}.dottmp.$$.$RANDOM"
_ztmp_register $REPLY
else
- for name in $*; do; _ztmp_register $name; done
+ for name in "$@"; do; _ztmp_register $name; done
fi
}
@@ -70,4 +70,4 @@ function ztmp_cleanup {
_ztmp_newshell
-ztmpfile $*
+ztmpfile "$@"
View
4 zsh/lib/memcache/functions/memcache
@@ -31,7 +31,7 @@ function memcache {
[[ -z $cmd ]] && { cmd=$1; shift }
- args=($*)
+ args=("$@")
if [[ -n $server ]]; then
saved_server=$memcache_vars[forced_server]
@@ -78,4 +78,4 @@ function memcache {
}
return
-}
+}
View
4 zsh/lib/memcache/functions/memcache:/memcache:misc_command
@@ -46,7 +46,7 @@ function memcache:misc_command {
cmd=$1
shift 1
- args=($*)
+ args=("$@")
local respline="" isdone=0 line="" data=""
@@ -81,4 +81,4 @@ function memcache:misc_command {
zctrace "islist=$islist $replyvar=${(P)replyvar}"
return $retval
-}
+}
View
4 zsh/lib/memcache/functions/memcache:/memcache:retrieval_command
@@ -53,7 +53,7 @@ function memcache:retrieval_command {
cmd=$1
shift 1
- keys=($*)
+ keys=("$@")
local respline="" done=0 line=""
local -a resppos
@@ -110,4 +110,4 @@ function memcache:retrieval_command {
REPLY=$firstdata
[[ $retval != 0 ]] && return $retval
[[ ${(P)#replyvar} -gt 0 ]]
-}
+}

0 comments on commit cb5221f

Please sign in to comment.