mirror of
https://github.com/systemd/systemd.git
synced 2025-01-13 17:18:18 +03:00
Merge pull request #2763 from tblume/shorten-hostname-before-removing-dots
shorten hostname before checking for trailing dot
This commit is contained in:
commit
2e8294bc20
@ -150,6 +150,8 @@ char* hostname_cleanup(char *s) {
|
|||||||
|
|
||||||
assert(s);
|
assert(s);
|
||||||
|
|
||||||
|
strshorten(s, HOST_NAME_MAX);
|
||||||
|
|
||||||
for (p = s, d = s, dot = true; *p; p++) {
|
for (p = s, d = s, dot = true; *p; p++) {
|
||||||
if (*p == '.') {
|
if (*p == '.') {
|
||||||
if (dot)
|
if (dot)
|
||||||
@ -169,8 +171,6 @@ char* hostname_cleanup(char *s) {
|
|||||||
else
|
else
|
||||||
*d = 0;
|
*d = 0;
|
||||||
|
|
||||||
strshorten(s, HOST_NAME_MAX);
|
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user