Browse Source

Fix quoting in bashum handlers

Alois Mahdal 9 months ago
parent
commit
5c18697676
1 changed files with 9 additions and 9 deletions
  1. 9
    9
      dotfiles/config/bashum/post.bashrc

+ 9
- 9
dotfiles/config/bashum/post.bashrc View File

@@ -102,13 +102,13 @@ __bashum__wdir() {
102 102
     #
103 103
     local mode=${1:-normal}
104 104
     case $mode:$PWD in
105
-        shrinky:*)              __bashum__shrinkypath "$PWD" ;;
106
-        normal:*)               echo "${PWD/$HOME/\~}" ;;
107
-        short:$HOME)            echo "~" ;;
108
-        short:$HOME/??????????) echo "${PWD/$HOME/\~}" ;;
109
-        short:$HOME/*/*)        echo "…${PWD##*/}" ;;
110
-        short:$HOME/*)          echo "${PWD/$HOME/\~}" ;;
111
-        short:*)                echo "$PWD" ;;
105
+        shrinky:*)                  __bashum__shrinkypath "$PWD" ;;
106
+        normal:*)                   echo "${PWD/$HOME/\~}" ;;
107
+        short:"$HOME")              echo "~" ;;
108
+        short:"$HOME"/??????????)   echo "${PWD/$HOME/\~}" ;;
109
+        short:"$HOME"/*/*)          echo "…${PWD##*/}" ;;
110
+        short:"$HOME"/*)            echo "${PWD/$HOME/\~}" ;;
111
+        short:*)                    echo "$PWD" ;;
112 112
     esac
113 113
 }
114 114
 
@@ -118,8 +118,8 @@ __bashum__shrinkypath() {
118 118
     #
119 119
     local path=$1
120 120
     case $path in
121
-        $HOME)      echo "~"; return ;;
122
-        $HOME/*)    echo -n "~"; __bashum__shrink_relpath "${path#$HOME/}" ;;
121
+        "$HOME")    echo "~"; return ;;
122
+        "$HOME"/*)  echo -n "~"; __bashum__shrink_relpath "${path#$HOME/}" ;;
123 123
         *)          echo "$path"; return ;;
124 124
     esac
125 125
 }