tree-wide: get rid of strappend()

It's a special case of strjoin(), so no need to keep both. In particular
as typing strjoin() is even shoert than strappend().
This commit is contained in:
Lennart Poettering
2019-07-12 14:31:12 +09:00
committed by Yu Watanabe
parent 6fa0524133
commit b910cc72c0
68 changed files with 115 additions and 146 deletions
+1 -1
View File
@@ -241,7 +241,7 @@ static int dump_processes(
special = special_glyph(more ? SPECIAL_GLYPH_TREE_VERTICAL : SPECIAL_GLYPH_TREE_SPACE);
pp = strappend(prefix, special);
pp = strjoin(prefix, special);
if (!pp)
return -ENOMEM;
+1 -1
View File
@@ -313,7 +313,7 @@ static int bus_append_exec_command(sd_bus_message *m, const char *field, const c
if (!is_ex_prop && (flags & (EXEC_COMMAND_NO_ENV_EXPAND|EXEC_COMMAND_FULLY_PRIVILEGED|EXEC_COMMAND_NO_SETUID|EXEC_COMMAND_AMBIENT_MAGIC))) {
/* Upgrade the ExecXYZ= property to ExecXYZEx= for convenience */
is_ex_prop = true;
upgraded_name = strappend(field, "Ex");
upgraded_name = strjoin(field, "Ex");
if (!upgraded_name)
return log_oom();
}
+1 -1
View File
@@ -990,7 +990,7 @@ int bus_message_print_all_properties(
return log_oom();
}
name_with_equal = strappend(name, "=");
name_with_equal = strjoin(name, "=");
if (!name_with_equal)
return log_oom();
+2 -2
View File
@@ -165,7 +165,7 @@ int show_cgroup_by_path(
printf("%s%s%s\n", prefix, special_glyph(SPECIAL_GLYPH_TREE_BRANCH), cg_unescape(basename(last)));
if (!p1) {
p1 = strappend(prefix, special_glyph(SPECIAL_GLYPH_TREE_VERTICAL));
p1 = strjoin(prefix, special_glyph(SPECIAL_GLYPH_TREE_VERTICAL));
if (!p1)
return -ENOMEM;
}
@@ -187,7 +187,7 @@ int show_cgroup_by_path(
printf("%s%s%s\n", prefix, special_glyph(SPECIAL_GLYPH_TREE_RIGHT), cg_unescape(basename(last)));
if (!p2) {
p2 = strappend(prefix, " ");
p2 = strjoin(prefix, " ");
if (!p2)
return -ENOMEM;
}
+1 -1
View File
@@ -2308,7 +2308,7 @@ int unit_file_revert(
has_vendor = true;
}
dropin = strappend(path, ".d");
dropin = strjoin(path, ".d");
if (!dropin)
return -ENOMEM;
+3 -3
View File
@@ -87,8 +87,8 @@ static char **image_settings_path(Image *image) {
fn = strjoina(image->name, ".nspawn");
FOREACH_STRING(s, "/etc/systemd/nspawn/", "/run/systemd/nspawn/") {
l[i] = strappend(s, fn);
FOREACH_STRING(s, "/etc/systemd/nspawn", "/run/systemd/nspawn") {
l[i] = path_join(s, fn);
if (!l[i])
return NULL;
@@ -441,7 +441,7 @@ int image_find(ImageClass class, const char *name, Image **ret) {
if (errno != ENOENT)
return -errno;
raw = strappend(name, ".raw");
raw = strjoin(name, ".raw");
if (!raw)
return -ENOMEM;
+6 -6
View File
@@ -32,7 +32,7 @@ int xdg_user_runtime_dir(char **ret, const char *suffix) {
if (!e)
return -ENXIO;
j = strappend(e, suffix);
j = strjoin(e, suffix);
if (!j)
return -ENOMEM;
@@ -49,7 +49,7 @@ int xdg_user_config_dir(char **ret, const char *suffix) {
e = getenv("XDG_CONFIG_HOME");
if (e)
j = strappend(e, suffix);
j = strjoin(e, suffix);
else {
_cleanup_free_ char *home = NULL;
@@ -81,7 +81,7 @@ int xdg_user_data_dir(char **ret, const char *suffix) {
e = getenv("XDG_DATA_HOME");
if (e)
j = strappend(e, suffix);
j = strjoin(e, suffix);
else {
_cleanup_free_ char *home = NULL;
@@ -270,15 +270,15 @@ static int acquire_generator_dirs(
prefix = strjoina(e, "/systemd");
}
x = strappend(prefix, "/generator");
x = path_join(prefix, "generator");
if (!x)
return -ENOMEM;
y = strappend(prefix, "/generator.early");
y = path_join(prefix, "generator.early");
if (!y)
return -ENOMEM;
z = strappend(prefix, "/generator.late");
z = path_join(prefix, "generator.late");
if (!z)
return -ENOMEM;