summaryrefslogtreecommitdiffstats
path: root/pw/pw_user.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2015-07-11 21:09:50 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2015-07-11 21:09:50 +0000
commitb145dd590b9033009a5dc5955a61937fece60522 (patch)
treea2cca41a69d3a73958f195fc7b81fbb48fe52340 /pw/pw_user.c
parent2e3f699c920ed9dfb675e7c721e38c3aad6e712b (diff)
downloadpw-darwin-b145dd590b9033009a5dc5955a61937fece60522.tar.gz
pw-darwin-b145dd590b9033009a5dc5955a61937fece60522.tar.zst
pw-darwin-b145dd590b9033009a5dc5955a61937fece60522.zip
check the gecos format early: at the moment the -c option is parsed
Diffstat (limited to 'pw/pw_user.c')
-rw-r--r--pw/pw_user.c7
1 files changed, 3 insertions, 4 deletions
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;
}
}