diff options
author | dteske <dteske@FreeBSD.org> | 2013-06-20 05:51:44 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2013-06-20 05:51:44 +0000 |
commit | 6dd0be38a0450ec90f9e4684f0041d758f021eb9 (patch) | |
tree | 4957e1ae4ce746d2433d6e9e1d49408ea168c9bc /usr.sbin/bsdconfig/startup | |
parent | 1a1d811a616414b6c513fdaec7249b7037a7cac4 (diff) | |
download | FreeBSD-src-6dd0be38a0450ec90f9e4684f0041d758f021eb9.zip FreeBSD-src-6dd0be38a0450ec90f9e4684f0041d758f021eb9.tar.gz |
When the fall-back of a case-statement is the last thing executed in a
while-loop _and_ all prior matches in the same case-statement either break
or continue, we can safely break the fall-back out of the case-statement.
This should improve readability and allow for longer-lines by reducing the
level of indentation by-one for the fall-back case.
(a continuation of SVN r252019)
Diffstat (limited to 'usr.sbin/bsdconfig/startup')
-rwxr-xr-x | usr.sbin/bsdconfig/startup/rcvar | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/usr.sbin/bsdconfig/startup/rcvar b/usr.sbin/bsdconfig/startup/rcvar index d90092d..784c433 100755 --- a/usr.sbin/bsdconfig/startup/rcvar +++ b/usr.sbin/bsdconfig/startup/rcvar @@ -197,21 +197,20 @@ while :; do dialog_menu_main || f_die f_dialog_menutag_fetch mtag - case "$mtag" in - "X $msg_exit") break ;; - *) # Anything else is an rcvar to toggle - rcvar="${mtag# }" - f_dialog_menuitem_fetch value - - # Determine the new [toggled] value to use - case "$value" in - "[X]"*) value="NO" ;; - *) value="YES" - esac - - err=$( f_sysrc_set "$rcvar" "$value" 2>&1 ) || - f_dialog_msgbox "$err" + [ "$mtag" = "X $msg_exit" ] && break + + # Anything else is an rcvar to toggle + + rcvar="${mtag# }" + f_dialog_menuitem_fetch value + + # Determine the new [toggled] value to use + case "$value" in + "[X]"*) value="NO" ;; + *) value="YES" esac + + err=$( f_sysrc_set "$rcvar" "$value" 2>&1 ) || f_dialog_msgbox "$err" done exit $SUCCESS |