fix quoted path
[lnf] / lnf-function
index 61478e7cddab32b3e2e9834c3074e5097ada43e9..1780c8e571fd4147703098ce38bc415b60752ba9 100644 (file)
@@ -39,8 +39,8 @@ replacing a file but not a directory. No ln option arguments are supported."
     elif [[ $# -ge 2 ]]; then
         if [[ -d ${!#} ]]; then
             local oldcwd=$PWD
-            cd ${!#} # last arg
-            for x in "${@:1:$(($#-1))}"; do # all but last arg
+            cd "${!#}" # last arg
+            for x in "${@:1:$(( $# - 1 ))}"; do # all but last arg
                 # remove any trailing slashes
                 x="${x%%+(/)}"
                 # remove any leading directory components