The second nit in ypldap code.
This deduplicates code a bit. Okay?
--
WBR,
Vadim Zhukov
Index: ypldap.c
===================================================================
RCS file: /cvs/src/usr.sbin/ypldap/ypldap.c,v
retrieving revision 1.21
diff -u -p -r1.21 ypldap.c
--- ypldap.c 20 Jan 2017 12:39:36 -0000 1.21
+++ ypldap.c 5 Dec 2017 10:09:45 -0000
@@ -239,17 +239,15 @@ main_create_user_groups(struct env *env)
if (!(cp = strsep(&bp, ",")))
break;
ukey.ue_line = cp;
- if ((ue = RB_FIND(user_name_tree, env->sc_user_names_t,
- &ukey)) == NULL) {
+ ue = RB_FIND(user_name_tree, env->sc_user_names_t,
&ukey);
+ if (bp != NULL)
+ *(bp-1) = ',';
+ if (ue == NULL) {
/* User not found */
log_warnx("main: unknown user %s in group %s\n",
ukey.ue_line, ge->ge_line);
- if (bp != NULL)
- *(bp-1) = ',';
continue;
}
- if (bp != NULL)
- *(bp-1) = ',';
/* Make sure the new group doesn't equal to the main
gid */
if (ge->ge_gid == ue->ue_gid)