X-Git-Url: http://git.tuebingen.mpg.de/?p=gsu.git;a=blobdiff_plain;f=gui;h=34f732e27bacc9646710efb0c11eef09659a2ce4;hp=6003a90ab18a11c51bf4ae4c0a98fa4e74c2bb38;hb=10bc168fc71c52c1767151e138a6b1031b837ea8;hpb=021cb6acbe9be83506f27e9eff3cd434e6daf149 diff --git a/gui b/gui index 6003a90..34f732e 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,14 @@ 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" rm -f "$tmp" # ignore errors