# This is like gsu_textbox() but the text is passed as a string.
gsu_msgbox()
{
+ local tmp
+
# Some versions of dialog segfault if the text is too long. Hence we
# always use a temporary file.
- local tmp="$(mktemp gsu_msgbox.XXXXXXXXXX)"
-
- if (($? != 0)); then
- ret=-$E_GSU_MKTEMP
- result='temp file for textbox'
- return
- fi
+ gsu_make_tempfile 'gsu_msgbox.XXXXXXXXXX'
+ (($ret < 0)) && return
+ tmp="$result"
trap "rm -f $tmp" EXIT
echo "$1" > "$tmp"
gsu_textbox "$tmp"