From 13824e6c6765b7a1d67b0ffaab60aa0612bee252 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sat, 11 Jul 2015 21:09:50 +0000 Subject: check the gecos format early: at the moment the -c option is parsed --- pw/pw_user.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'pw/pw_user.c') diff --git a/pw/pw_user.c b/pw/pw_user.c index 7e8534e..9e16793 100644 --- a/pw/pw_user.c +++ b/pw/pw_user.c @@ -650,10 +650,9 @@ pw_user(int mode, char *name, long id, struct cargs * args) /* * Shared add/edit code */ - if ((arg = getarg(args, 'c')) != NULL) { - char *gecos = pw_checkname(arg->val, 1); - if (strcmp(pwd->pw_gecos, gecos) != 0) { - pwd->pw_gecos = gecos; + if (conf.gecos != NULL) { + if (strcmp(pwd->pw_gecos, conf.gecos) != 0) { + pwd->pw_gecos = conf.gecos; edited = 1; } } -- cgit v1.2.3-56-ge451