Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Jun 2013 22:45:54 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r251267 - head/usr.sbin/bsdconfig/share
Message-ID:  <201306022245.r52MjsL6082040@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306022245.r52MjsL6082040>