浏览代码

Fix format: use double quote to prevent globbing and word splitting

csmk 8 年之前
父节点
当前提交
f589a1d245
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      dnsapi/dns_knot.sh

+ 2 - 2
dnsapi/dns_knot.sh

@@ -73,10 +73,10 @@ EOF
 _get_root() {
   domain=$1
   i="$(echo "$fulldomain" | tr '.' ' ' | wc -w)"
-  i=$(_math $i - 1)
+  i=$(_math "$i" - 1)
 
   while true; do
-    h=$(printf "%s" "$domain" | cut -d . -f $i-100)
+    h=$(printf "%s" "$domain" | cut -d . -f "$i"-100)
     if [ -z "$h" ]; then
       return 1
     fi