| 58 | } |
| 59 | |
| 60 | static void copy_gecos(const struct passwd *w, struct strbuf *name) |
| 61 | { |
| 62 | const char *src; |
| 63 | |
| 64 | /* Traditionally GECOS field had office phone numbers etc, separated |
| 65 | * with commas. Also & stands for capitalized form of the login name. |
| 66 | */ |
| 67 | |
| 68 | for (src = get_gecos(w); *src && *src != ','; src++) { |
| 69 | int ch = *src; |
| 70 | if (ch != '&') |
| 71 | strbuf_addch(name, ch); |
| 72 | else { |
| 73 | /* Sorry, Mr. McDonald... */ |
| 74 | strbuf_addch(name, toupper(*w->pw_name)); |
| 75 | strbuf_addstr(name, w->pw_name + 1); |
| 76 | } |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | static int add_mailname_host(struct strbuf *buf) |
| 81 | { |
no test coverage detected