diff options
author | dteske <dteske@FreeBSD.org> | 2013-06-02 22:45:54 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2013-06-02 22:45:54 +0000 |
commit | 6ece0c7e999f8c856e9208c95b80e3aa1562815b (patch) | |
tree | 06491488db3e6a1d1d5592c178051ff6ccd07b5e /usr.sbin/bsdconfig/share | |
parent | 6ffb8bc7f6d4d5ba800c2d70733d9a242419bbdd (diff) | |
download | FreeBSD-src-6ece0c7e999f8c856e9208c95b80e3aa1562815b.zip FreeBSD-src-6ece0c7e999f8c856e9208c95b80e3aa1562815b.tar.gz |
Make proper use of locals in f_dialog_init().
Diffstat (limited to 'usr.sbin/bsdconfig/share')
-rw-r--r-- | usr.sbin/bsdconfig/share/dialog.subr | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/bsdconfig/share/dialog.subr b/usr.sbin/bsdconfig/share/dialog.subr index 1da5320..badca9f 100644 --- a/usr.sbin/bsdconfig/share/dialog.subr +++ b/usr.sbin/bsdconfig/share/dialog.subr @@ -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." |