summaryrefslogtreecommitdiff
path: root/mail/mutt/patches/patch-ac
blob: e463019fa76df9f5a6a9218f5d6d5b05992e5dc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$NetBSD: patch-ac,v 1.2 2000/05/20 18:41:41 kim Exp $

--- init.c	2000/05/17 03:35:49	2.29
+++ init.c	2000/05/20 07:30:46
@@ -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 @@
   /* 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