MCPcopy Create free account
hub / github.com/git/git / add_domainname

Function add_domainname

ident.c:129–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129static void add_domainname(struct strbuf *out, int *is_bogus)
130{
131 char buf[HOST_NAME_MAX + 1];
132
133 if (xgethostname(buf, sizeof(buf))) {
134 warning_errno("cannot get host name");
135 strbuf_addstr(out, "(none)");
136 *is_bogus = 1;
137 return;
138 }
139 if (strchr(buf, '.'))
140 strbuf_addstr(out, buf);
141 else if (canonical_name(buf, out) < 0) {
142 strbuf_addf(out, "%s.(none)", buf);
143 *is_bogus = 1;
144 }
145}
146
147static void copy_email(const struct passwd *pw, struct strbuf *email,
148 int *is_bogus)

Callers 1

copy_emailFunction · 0.85

Calls 5

xgethostnameFunction · 0.85
warning_errnoFunction · 0.85
strbuf_addstrFunction · 0.85
canonical_nameFunction · 0.85
strbuf_addfFunction · 0.85

Tested by

no test coverage detected