diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2000-05-20 07:48:26 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2000-05-20 07:48:26 +0000 |
commit | ac4ab5a0f4df5650685ef1459f4319a3d96c0082 (patch) | |
tree | 43cfda73a984d2a8c5f163169a3a973d2d516768 /init.c | |
parent | b67187c39a64501c3e870bda11ac83b2be6c1201 (diff) |
Add mutt_gecos_name function which centrally handles the GECOS
processing.
Diffstat (limited to 'init.c')
-rw-r--r-- | init.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -42,7 +42,6 @@ #include "init.h" #include "mailbox.h" -#include <pwd.h> #include <ctype.h> #include <stdlib.h> #include <unistd.h> @@ -1710,13 +1709,13 @@ void mutt_init (int skip_sys_rc, LIST *commands) /* Get some information about the user */ if ((pw = getpwuid (getuid ()))) { + char rnbuf[STRING]; + Username = safe_strdup (pw->pw_name); if (!Homedir) Homedir = safe_strdup (pw->pw_dir); - if ((p = strchr (pw->pw_gecos, ','))) - Realname = mutt_substrdup (pw->pw_gecos, p); - else - Realname = safe_strdup (pw->pw_gecos); + + Realname = safe_strdup (mutt_gecos_name (rnbuf, sizeof (rnbuf), pw)); Shell = safe_strdup (pw->pw_shell); } else |