summaryrefslogtreecommitdiffstats
path: root/init.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2000-05-20 07:48:26 +0000
committerThomas Roessler <roessler@does-not-exist.org>2000-05-20 07:48:26 +0000
commitac4ab5a0f4df5650685ef1459f4319a3d96c0082 (patch)
tree43cfda73a984d2a8c5f163169a3a973d2d516768 /init.c
parentb67187c39a64501c3e870bda11ac83b2be6c1201 (diff)
Add mutt_gecos_name function which centrally handles the GECOS
processing.
Diffstat (limited to 'init.c')
-rw-r--r--init.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/init.c b/init.c
index 7e155e6d..7f0bef29 100644
--- a/init.c
+++ b/init.c
@@ -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