Browse Source

Fix quoting in bashum handlers

Alois Mahdal 8 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
     #
102
     #
103
     local mode=${1:-normal}
103
     local mode=${1:-normal}
104
     case $mode:$PWD in
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
     esac
112
     esac
113
 }
113
 }
114
 
114
 
118
     #
118
     #
119
     local path=$1
119
     local path=$1
120
     case $path in
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
         *)          echo "$path"; return ;;
123
         *)          echo "$path"; return ;;
124
     esac
124
     esac
125
 }
125
 }