From owner-svn-src-all@FreeBSD.ORG Thu Jun 20 05:51:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5FD7B1EF; Thu, 20 Jun 2013 05:51:45 +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 387A01B30; Thu, 20 Jun 2013 05:51:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5K5piMd033974; Thu, 20 Jun 2013 05:51:44 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5K5pi5O033972; Thu, 20 Jun 2013 05:51:44 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201306200551.r5K5pi5O033972@svn.freebsd.org> From: Devin Teske Date: Thu, 20 Jun 2013 05:51:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252020 - in head/usr.sbin/bsdconfig: startup usermgmt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2013 05:51:45 -0000 Author: dteske Date: Thu Jun 20 05:51:44 2013 New Revision: 252020 URL: http://svnweb.freebsd.org/changeset/base/252020 Log: 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) Modified: head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/usermgmt/groupdel Modified: head/usr.sbin/bsdconfig/startup/rcvar ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcvar Thu Jun 20 05:48:08 2013 (r252019) +++ head/usr.sbin/bsdconfig/startup/rcvar Thu Jun 20 05:51:44 2013 (r252020) @@ -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 + [ "$mtag" = "X $msg_exit" ] && break - err=$( f_sysrc_set "$rcvar" "$value" 2>&1 ) || - f_dialog_msgbox "$err" + # 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 Modified: head/usr.sbin/bsdconfig/usermgmt/groupdel ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/groupdel Thu Jun 20 05:48:08 2013 (r252019) +++ head/usr.sbin/bsdconfig/usermgmt/groupdel Thu Jun 20 05:51:44 2013 (r252020) @@ -77,13 +77,12 @@ while :; do [ $retval -eq 0 ] || f_die - case "$mtag" in - "X $msg_exit") break ;; - *) # anything else is a group name - $BSDCFG_LIBE/$APP_DIR/groupinput \ - ${USE_XDIALOG:+-X} mode="Delete" group="$mtag" - ;; - esac + [ "$mtag" = "X $msg_exit" ] && break + + # Anything else is a group name + + $BSDCFG_LIBE/$APP_DIR/groupinput \ + ${USE_XDIALOG:+-X} mode="Delete" group="$mtag" done exit $SUCCESS