From owner-svn-src-head@FreeBSD.ORG Sun Jun 2 22:45:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C8122887; Sun, 2 Jun 2013 22:45:54 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B9F0E1BC4; Sun, 2 Jun 2013 22:45:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r52Mjsfh082041; Sun, 2 Jun 2013 22:45:54 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r52MjsL6082040; Sun, 2 Jun 2013 22:45:54 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201306022245.r52MjsL6082040@svn.freebsd.org> From: Devin Teske Date: Sun, 2 Jun 2013 22:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251267 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jun 2013 22:45:54 -0000 Author: dteske Date: Sun Jun 2 22:45:54 2013 New Revision: 251267 URL: http://svnweb.freebsd.org/changeset/base/251267 Log: Make proper use of locals in f_dialog_init(). Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Sun Jun 2 22:34:40 2013 (r251266) +++ head/usr.sbin/bsdconfig/share/dialog.subr Sun Jun 2 22:45:54 2013 (r251267) @@ -2000,7 +2000,7 @@ f_dialog_init() # if ! f_have $DIALOG; then unset USE_XDIALOG - failed_dialog="$DIALOG" + local failed_dialog="$DIALOG" DIALOG=dialog f_die 1 "$msg_no_such_file_or_directory" "$pgm" "$failed_dialog" fi @@ -2021,7 +2021,7 @@ f_dialog_init() f_die 1 "$msg_no_such_file_or_directory" "$pgm" "xauth" fi HOSTNAME=$(hostname) - displaynum="${DISPLAY#*:}" + local displaynum="${DISPLAY#*:}" eval xauth -if \~$SUDO_USER/.Xauthority extract - \ \"\$HOSTNAME/unix:\$displaynum\" \ \"\$HOSTNAME:\$displaynum\" | sudo sh -c 'xauth -ivf \ @@ -2033,6 +2033,7 @@ f_dialog_init() # gracefully # if [ "$USE_XDIALOG" ]; then + local maxsize if ! maxsize=$( LANG= LC_ALL= $DIALOG --print-maxsize 2>&1 ) then # Xdialog(1) failed, fall back to dialog(1) @@ -2058,7 +2059,6 @@ f_dialog_init() echo $height $width ) - unset maxsize fi # @@ -2068,10 +2068,9 @@ f_dialog_init() # --title with Xdialog(1)). # if [ "$USE_XDIALOG" ]; then - _DIALOG_TITLE="$DIALOG_TITLE" + local _DIALOG_TITLE="$DIALOG_TITLE" DIALOG_TITLE="$DIALOG_BACKTITLE" DIALOG_BACKTITLE="$_DIALOG_TITLE" - unset _DIALOG_TITLE fi f_dprintf "f_dialog_init: dialog(1) API initialized."