X-Git-Url: http://git.tuebingen.mpg.de/?p=gsu.git;a=blobdiff_plain;f=gui;h=2e8b40feb35b10aaba383375aedabea844443d89;hp=f60819668035d53356b6cf8cddf735512fe53ed5;hb=a83461ac7e653a1caece11dba3f16c6db6fe8509;hpb=dd72676c4bd2cc300a655d5c0bf202fc0a559c6f diff --git a/gui b/gui index f608196..2e8b40f 100644 --- a/gui +++ b/gui @@ -1,4 +1,6 @@ #!/bin/bash +# Copyright (C) 2006 Andre Noll +# Licensed under the LGPL, version 3. See COPYING and COPYING.LESSER. if [[ "$(type -t _gsu_setup)" != "function" ]]; then gsu_dir=${gsu_dir:-${BASH_SOURCE[0]%/*}} @@ -78,15 +80,13 @@ gsu_textbox() # 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" @@ -97,7 +97,7 @@ _gsu_menu() { local header="${1:-root}" local items="$2" - local i state opts num=0 + local i opts num=0 _get_geometry opts="$result 16"