Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Jun 2015 11:35:35 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r284113 - head/usr.sbin/pw
Message-ID:  <201506071135.t57BZZJa091550@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Sun Jun  7 11:35:34 2015
New Revision: 284113
URL: https://svnweb.freebsd.org/changeset/base/284113

Log:
  Improve readability by reducing indentations levels

Modified:
  head/usr.sbin/pw/pw_user.c

Modified: head/usr.sbin/pw/pw_user.c
==============================================================================
--- head/usr.sbin/pw/pw_user.c	Sun Jun  7 11:30:33 2015	(r284112)
+++ head/usr.sbin/pw/pw_user.c	Sun Jun  7 11:35:34 2015	(r284113)
@@ -1122,15 +1122,17 @@ delete_user(struct userconf *cnf, struct
 	while ((grp = GETGRENT()) != NULL) {
 		int i, j;
 		char group[MAXLOGNAME];
-		if (grp->gr_mem != NULL) {
-			for (i = 0; grp->gr_mem[i] != NULL; i++) {
-				if (!strcmp(grp->gr_mem[i], a_name->val)) {
-					for (j = i; grp->gr_mem[j] != NULL; j++)
-						grp->gr_mem[j] = grp->gr_mem[j+1];
-					strlcpy(group, grp->gr_name, MAXLOGNAME);
-					chggrent(group, grp);
-				}
-			}
+		if (grp->gr_mem == NULL)
+			continue;
+
+		for (i = 0; grp->gr_mem[i] != NULL; i++) {
+			if (strcmp(grp->gr_mem[i], a_name->val))
+				continue;
+
+			for (j = i; grp->gr_mem[j] != NULL; j++)
+				grp->gr_mem[j] = grp->gr_mem[j+1];
+			strlcpy(group, grp->gr_name, MAXLOGNAME);
+			chggrent(group, grp);
 		}
 	}
 	ENDGRENT();



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