From: Simon Ruderich Date: Sat, 14 Jan 2012 14:41:24 +0000 (+0100) Subject: shell/function,zsh/rc: Replace $@ with "$@". X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=commitdiff_plain;h=63303c2286c404830994aa1a7f7f62dc1e2be248 shell/function,zsh/rc: Replace $@ with "$@". "$@" is the only correct usage of $@. --- diff --git a/shell/functions b/shell/functions index 4de9453..f3a4096 100644 --- a/shell/functions +++ b/shell/functions @@ -7,7 +7,7 @@ # available everywhere. source_debug() { if [ x$DEBUG != x ]; then - echo $@ + echo "$@" fi } diff --git a/zsh/rc b/zsh/rc index 84b27f7..ccc8ea7 100644 --- a/zsh/rc +++ b/zsh/rc @@ -78,17 +78,17 @@ if [[ $ZSH_VERSION != (4.3.<5->|4.<4->*|<5->*) ]]; then # arrays. function precmd() { for function in $precmd_functions; do - $function $@ + $function "$@" done } function preexec() { for function in $preexec_functions; do - $function $@ + $function "$@" done } function chpwd() { for function in $chpwd_functions; do - $function $@ + $function "$@" done } fi