Fix quote syntax errors

This commit is contained in:
Dylan Araps 2016-11-06 21:32:29 +11:00
parent 6b0a9ebf94
commit 730a8b0290

View file

@ -170,9 +170,9 @@ getdistro() {
done done
case "$distro_shorthand" in case "$distro_shorthand" in
"on") distro="${NAME:-"${DISTRIB_ID}"} ${VERSION_ID:-"${DISTRIB_RELEASE}"}" ;; "on") distro="${NAME:-${DISTRIB_ID}} ${VERSION_ID:-${DISTRIB_RELEASE}}" ;;
"tiny") distro="${NAME:-"${DISTRIB_ID:-"${TAILS_PRODUCT_NAME}"}"}" ;; "tiny") distro="${NAME:-${DISTRIB_ID:-${TAILS_PRODUCT_NAME}}}" ;;
"off") distro="${PRETTY_NAME:-"${DISTRIB_DESCRIPTION}"} ${UBUNTU_CODENAME}" ;; "off") distro="${PRETTY_NAME:-${DISTRIB_DESCRIPTION}} ${UBUNTU_CODENAME}" ;;
esac esac
# Workarounds for distros that go against the os-release standard. # Workarounds for distros that go against the os-release standard.
@ -1542,11 +1542,12 @@ gettermfont() {
"urxvt" | "urxvtd" | "xterm") "urxvt" | "urxvtd" | "xterm")
termfont="$(grep -i -F "${term/d}*font" <<< "$(xrdb -query)")" termfont="$(grep -i -F "${term/d}*font" <<< "$(xrdb -query)")"
termfont="${termfont/*font:}" termfont="${termfont/*font:}"
termfont="$(trim "$termfont")"
# Xresources has two different font syntax, this checks which # Xresources has two different font syntax, this checks which
# one is in use and formats it accordingly. # one is in use and formats it accordingly.
case "$termfont" in case "$termfont" in
"xft:"*) *"xft:"*)
termfont="${termfont/xft:}" termfont="${termfont/xft:}"
termfont="${termfont/:*}" termfont="${termfont/:*}"
;; ;;
@ -2353,7 +2354,7 @@ info() {
# Call the function and update variable # Call the function and update variable
"get${2:-$1}" 2>/dev/null "get${2:-$1}" 2>/dev/null
eval output="\$${2:-"$1"}" eval output="\$${2:-$1}"
# Trim whitespace # Trim whitespace
output="$(trim "$output")" output="$(trim "$output")"
@ -2405,7 +2406,7 @@ info() {
# Prin {{{ # Prin {{{
prin() { prin() {
string="${1//$'\033[0m'}${2:+: "$2"}" string="${1//$'\033[0m'}${2:+: $2}"
# If $2 doesn't exist we format $1 as info # If $2 doesn't exist we format $1 as info
[ -z "$2" ] && local subtitle_color="$info_color" [ -z "$2" ] && local subtitle_color="$info_color"