util: rework strappenda(), and rename it strjoina()
After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
This commit is contained in:
+3
-3
@@ -1582,9 +1582,9 @@ static int exec_child(
|
||||
|
||||
if (context->private_tmp && runtime) {
|
||||
if (runtime->tmp_dir)
|
||||
tmp = strappenda(runtime->tmp_dir, "/tmp");
|
||||
tmp = strjoina(runtime->tmp_dir, "/tmp");
|
||||
if (runtime->var_tmp_dir)
|
||||
var = strappenda(runtime->var_tmp_dir, "/tmp");
|
||||
var = strjoina(runtime->var_tmp_dir, "/tmp");
|
||||
}
|
||||
|
||||
r = setup_namespace(
|
||||
@@ -2588,7 +2588,7 @@ void exec_command_dump(ExecCommand *c, FILE *f, const char *prefix) {
|
||||
assert(f);
|
||||
|
||||
prefix = strempty(prefix);
|
||||
prefix2 = strappenda(prefix, "\t");
|
||||
prefix2 = strjoina(prefix, "\t");
|
||||
|
||||
cmd = exec_command_line(c->argv);
|
||||
fprintf(f,
|
||||
|
||||
Reference in New Issue
Block a user