hostname-util: get rid of unused parameter of hostname_cleanup()
All users are now setting lowercase=false.
This commit is contained in:
@@ -105,7 +105,7 @@ bool hostname_is_valid(const char *s, bool relax) {
|
||||
return true;
|
||||
}
|
||||
|
||||
char* hostname_cleanup(char *s, bool lowercase) {
|
||||
char* hostname_cleanup(char *s) {
|
||||
char *p, *d;
|
||||
bool dot;
|
||||
|
||||
@@ -119,7 +119,7 @@ char* hostname_cleanup(char *s, bool lowercase) {
|
||||
*(d++) = '.';
|
||||
dot = true;
|
||||
} else if (hostname_valid_char(*p)) {
|
||||
*(d++) = lowercase ? tolower(*p) : *p;
|
||||
*(d++) = *p;
|
||||
dot = false;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ int read_hostname_config(const char *path, char **hostname) {
|
||||
truncate_nl(l);
|
||||
if (l[0] != '\0' && l[0] != '#') {
|
||||
/* found line with value */
|
||||
name = hostname_cleanup(l, false);
|
||||
name = hostname_cleanup(l);
|
||||
name = strdup(name);
|
||||
if (!name)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -30,7 +30,7 @@ bool hostname_is_set(void);
|
||||
char* gethostname_malloc(void);
|
||||
|
||||
bool hostname_is_valid(const char *s, bool relax) _pure_;
|
||||
char* hostname_cleanup(char *s, bool lowercase);
|
||||
char* hostname_cleanup(char *s);
|
||||
|
||||
bool is_localhost(const char *hostname);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user