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
31
32
33
34
35
36
37
38
39
40
|
$NetBSD: patch-aa,v 1.4 2000/05/20 18:41:38 kim Exp $
--- alias.c 2000/03/04 08:40:52 2.11
+++ alias.c 2000/05/20 07:30:10
@@ -20,7 +20,6 @@
#include "mutt_regex.h"
#include "mutt_curses.h"
-#include <pwd.h>
#include <string.h>
ADDRESS *mutt_lookup_alias (const char *s)
@@ -86,22 +85,11 @@
if (pw)
{
- regmatch_t pat_match[1];
-
- /* Use regular expression to parse Gecos field. This result of the
- * parsing will be used as the personal ID string when the alias is
- * expanded.
- */
- if (regexec (GecosMask.rx, pw->pw_gecos, 1, pat_match, 0) == 0)
- {
- /* Malloc enough for the matching pattern + terminating NULL */
- a->personal = safe_malloc ((pat_match[0].rm_eo -
- pat_match[0].rm_so) + 1);
-
- strfcpy (a->personal, pw->pw_gecos + pat_match[0].rm_so,
- pat_match[0].rm_eo - pat_match[0].rm_so + 1);
- }
-
+ char namebuf[STRING];
+
+ mutt_gecos_name (namebuf, sizeof (namebuf), pw);
+ mutt_str_replace (&a->personal, namebuf);
+
#ifdef EXACT_ADDRESS
FREE (&a->val);
#endif
|