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
1 changed files with 10 additions and 3 deletions

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
}