From d1ece6874f4d51ba0887b2b4e0cb556dfe555466 Mon Sep 17 00:00:00 2001 From: dteske Date: Fri, 26 Apr 2013 21:28:24 +0000 Subject: Properly sanitize --menu results (guards against Gtk library warnings from X11 side of things from bleeding into Xdialog(1) stderr output). It should be duely noted that such errors are not a by-product of anything in the Xdialog(1) utility or API, but optional libraries that it can link against (such as Gtk1 versus Gtk2; if you compile xdialog from ports against Gtk2 AND misconfigure your fonts or generally make Gtk2 unhappy, these warning messages can bleed into the captured stderr -- that is we we sanitize!). --- usr.sbin/bsdconfig/share/device.subr | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'usr.sbin/bsdconfig/share/device.subr') diff --git a/usr.sbin/bsdconfig/share/device.subr b/usr.sbin/bsdconfig/share/device.subr index ad6c64c..c1a7b16 100644 --- a/usr.sbin/bsdconfig/share/device.subr +++ b/usr.sbin/bsdconfig/share/device.subr @@ -645,7 +645,12 @@ f_device_menu() [ "$errexit" ] && set -e - [ $retval -eq 0 ] && echo "$mtag" >&2 + if [ $retval -eq 0 ]; then + # Clean up the output of [X]dialog(1) and return it + setvar DIALOG_MENU_$$ "$mtag" + mtag=$( f_dialog_menutag ) + echo "$mtag" >&2 + fi return $retval } -- cgit v1.1