mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 03:25:31 +03:00
sysv-generator: use strextend_with_separator()
This commit is contained in:
parent
742a011a3a
commit
580bf61304
@ -533,7 +533,7 @@ static int load_sysv(SysvStub *s) {
|
||||
* continuation */
|
||||
|
||||
size_t k;
|
||||
char *j;
|
||||
const char *j;
|
||||
|
||||
k = strlen(t);
|
||||
if (k > 0 && t[k-1] == '\\')
|
||||
@ -542,19 +542,8 @@ static int load_sysv(SysvStub *s) {
|
||||
state = NORMAL;
|
||||
|
||||
j = strstrip(t);
|
||||
if (!isempty(j)) {
|
||||
char *d = NULL;
|
||||
|
||||
if (chkconfig_description)
|
||||
d = strjoin(chkconfig_description, " ", j);
|
||||
else
|
||||
d = strdup(j);
|
||||
if (!d)
|
||||
return log_oom();
|
||||
|
||||
free(chkconfig_description);
|
||||
chkconfig_description = d;
|
||||
}
|
||||
if (!isempty(j) && !strextend_with_separator(&chkconfig_description, " ", j))
|
||||
return log_oom();
|
||||
|
||||
} else if (IN_SET(state, LSB, LSB_DESCRIPTION)) {
|
||||
|
||||
@ -604,20 +593,8 @@ static int load_sysv(SysvStub *s) {
|
||||
const char *j;
|
||||
|
||||
j = strstrip(t);
|
||||
if (!isempty(j)) {
|
||||
char *d = NULL;
|
||||
|
||||
if (long_description)
|
||||
d = strjoin(long_description, " ", t);
|
||||
else
|
||||
d = strdup(j);
|
||||
if (!d)
|
||||
return log_oom();
|
||||
|
||||
free(long_description);
|
||||
long_description = d;
|
||||
}
|
||||
|
||||
if (!isempty(j) && !strextend_with_separator(&long_description, " ", j))
|
||||
return log_oom();
|
||||
} else
|
||||
state = LSB;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user