Author: dteske
Date: Fri Apr 26 21:28:24 2013
New Revision: 249955
URL: http://svnweb.freebsd.org/changeset/base/249955

Log:
  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!).

Modified:
  head/usr.sbin/bsdconfig/share/device.subr
  head/usr.sbin/bsdconfig/share/media/tcpip.subr

Modified: head/usr.sbin/bsdconfig/share/device.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/device.subr   Fri Apr 26 21:19:05 2013        
(r249954)
+++ head/usr.sbin/bsdconfig/share/device.subr   Fri Apr 26 21:28:24 2013        
(r249955)
@@ -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
 }

Modified: head/usr.sbin/bsdconfig/share/media/tcpip.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/media/tcpip.subr      Fri Apr 26 21:19:05 
2013        (r249954)
+++ head/usr.sbin/bsdconfig/share/media/tcpip.subr      Fri Apr 26 21:28:24 
2013        (r249955)
@@ -1399,6 +1399,8 @@ f_device_dialog_tcp()
                                        2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
                                )
                                local retval=$?
+                               setvar DIALOG_MENU_$$ "$cp"
+                               cp=$( f_dialog_menutag )
                                f_dprintf "retval=%u mtag=[%s]" $retval "$cp"
 
                                if [ $retval -eq 2 ]; then
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to