浏览代码

[wd] fix space in path

Markus Faerevaag 10 年之前
父节点
当前提交
9f801ff48d
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      plugins/wd/wd.sh

+ 2 - 2
plugins/wd/wd.sh

@@ -139,7 +139,7 @@ wd_add()
     if [[ $point =~ "^[\.]+$" ]]
     then
         wd_exit_fail "Warp point cannot be just dots"
-    elif [[ $point =~ "(\s|\ )+" ]]
+    elif [[ $point =~ "[[:space:]]+" ]]
     then
         wd_exit_fail "Warp point should not contain whitespace"
     elif [[ $point == *:* ]]
@@ -151,7 +151,7 @@ wd_add()
     elif [[ ${points[$2]} == "" ]] || $force
     then
         wd_remove $point > /dev/null
-        printf "%q:%q\n" "${point}" "${PWD}" >> $WD_CONFIG
+        printf "%q:%s\n" "${point}" "${PWD}" >> $WD_CONFIG
 
         wd_print_msg $WD_GREEN "Warp point added"