chiark / gitweb /
mklinks.in: Don't make directories if the link name doesn't contain `/'.
[cfd] / mklinks.in
index 34358799ac0a825f0eda9466cefc5efb018a9a93..3548946110f20333d254d3ba15e7f7d3c57685c3 100755 (executable)
@@ -76,9 +76,8 @@ cat "$@" | while read name; do
     *=*) want=${name##*=}; name=${name%=*} ;;
     *) want=${name##*/} ;;
   esac
-  dir=${name%/*}
   if [ -r "$pkgdatadir/$want" ]; then
-    mkdir -p "$dir"
+    case "$name" in */*) mkdir -p "${name%/*}" ;; esac
     rm -f "$name"
     ln -sf "$pkgdatadir/$want" "$name"
   fi