ebuild-helpers/bsd/sed: whitespace + quoting
authorZac Medico <zmedico@gentoo.org>
Sun, 2 Sep 2012 22:13:24 +0000 (15:13 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 2 Sep 2012 22:13:24 +0000 (15:13 -0700)
bin/ebuild-helpers/bsd/sed

index cc447696d6345ca681a4fdcd97bd2a6c332f46d9..01b88471d94bca8b660e5bdbe6dcdf3e1249b3a2 100755 (executable)
@@ -5,23 +5,23 @@
 scriptpath=${BASH_SOURCE[0]}
 scriptname=${scriptpath##*/}
 
-if [[ sed == ${scriptname} ]] && [[ -n ${ESED} ]]; then
+if [[ sed == ${scriptname} && -n ${ESED} ]]; then
        exec ${ESED} "$@"
 elif type -P g${scriptname} > /dev/null ; then
        exec g${scriptname} "$@"
 else
        old_IFS="${IFS}"
        IFS=":"
+
        for path in $PATH; do
                if [[ -x ${path}/${scriptname} ]]; then
                        [[ ${path}/${scriptname} -ef ${scriptpath} ]] && continue
-                       exec ${path}/${scriptname} "$@"
+                       exec "${path}/${scriptname}" "$@"
                        exit 0
                fi
        done
-       
+
        IFS="${old_IFS}"
 fi
+
 exit 1