term_font: Fix crash when parsing Xresources. Closes #1195

This commit is contained in:
Dylan Araps 2019-02-11 17:12:31 +02:00
parent 6e9f00445f
commit 7fd9ff75a3

View file

@ -4194,10 +4194,17 @@ term_padding() {
case "$term" in
urxvt*|"rxvt-unicode")
[[ -z "$xrdb" ]] && xrdb="$(xrdb -query)"
[[ $xrdb != *.internalBorder:* ]] && return
[[ -z "$xrdb" ]] &&
xrdb="$(xrdb -query)"
[[ $xrdb != *".internalBorder:"* ]] &&
return
padding="${xrdb/*.internalBorder:}"
((padding=${padding/$'\n'*}))
padding="${padding/$'\n'*}"
[[ $padding =~ ^[0-9]+$ ]] ||
padding=
;;
esac
}